This commit is contained in:
IGNY8 VPS (Salman)
2025-11-29 08:59:31 +00:00
parent 4bea79a76d
commit 4237c203b4
18 changed files with 507 additions and 52 deletions

View File

@@ -104,12 +104,12 @@ export const createContentPageConfig = (
{handlers.onRowClick ? (
<button
onClick={() => handlers.onRowClick!(row)}
className="font-medium text-blue-500 hover:text-blue-600 hover:underline text-left transition-colors"
className="text-base font-light text-blue-500 hover:text-blue-600 hover:underline text-left transition-colors"
>
{row.title || `Content #${row.id}`}
</button>
) : (
<div className="font-medium text-gray-900 dark:text-white">
<div className="text-base font-light text-gray-900 dark:text-white">
{row.title || `Content #${row.id}`}
</div>
)}
@@ -178,24 +178,48 @@ export const createContentPageConfig = (
},
},
{
key: 'taxonomy_terms',
key: 'tags',
label: 'Tags',
sortable: false,
width: '150px',
render: (_value: any, row: Content) => {
const taxonomyTerms = row.taxonomy_terms;
if (!taxonomyTerms || taxonomyTerms.length === 0) {
const tags = row.tags || [];
if (!tags || tags.length === 0) {
return <span className="text-gray-400 dark:text-gray-500 text-[11px]">-</span>;
}
return (
<div className="flex flex-wrap gap-1">
{taxonomyTerms.slice(0, 2).map((term) => (
<Badge key={term.id} color="pink" size="xs" variant="soft">
<span className="text-[11px] font-normal">{term.name}</span>
{tags.slice(0, 2).map((tag, index) => (
<Badge key={`${tag}-${index}`} color="pink" size="xs" variant="soft">
<span className="text-[11px] font-normal">{tag}</span>
</Badge>
))}
{taxonomyTerms.length > 2 && (
<span className="text-[11px] text-gray-500">+{taxonomyTerms.length - 2}</span>
{tags.length > 2 && (
<span className="text-[11px] text-gray-500">+{tags.length - 2}</span>
)}
</div>
);
},
},
{
key: 'categories',
label: 'Categories',
sortable: false,
width: '150px',
render: (_value: any, row: Content) => {
const categories = row.categories || [];
if (!categories || categories.length === 0) {
return <span className="text-gray-400 dark:text-gray-500 text-[11px]">-</span>;
}
return (
<div className="flex flex-wrap gap-1">
{categories.slice(0, 2).map((category, index) => (
<Badge key={`${category}-${index}`} color="blue" size="xs" variant="soft">
<span className="text-[11px] font-normal">{category}</span>
</Badge>
))}
{categories.length > 2 && (
<span className="text-[11px] text-gray-500">+{categories.length - 2}</span>
)}
</div>
);