New Columns and columns visibility
This commit is contained in:
@@ -27,6 +27,7 @@ export interface ColumnConfig {
|
||||
toggleable?: boolean;
|
||||
toggleContentKey?: string;
|
||||
toggleContentLabel?: string;
|
||||
defaultVisible?: boolean; // Whether column is visible by default (default: true)
|
||||
}
|
||||
|
||||
export interface FilterConfig {
|
||||
@@ -124,7 +125,8 @@ export const createContentPageConfig = (
|
||||
{
|
||||
key: 'primary_keyword',
|
||||
label: 'Primary Keyword',
|
||||
sortable: false,
|
||||
sortable: true,
|
||||
sortField: 'primary_keyword',
|
||||
width: '150px',
|
||||
render: (value: string, row: Content) => (
|
||||
row.primary_keyword ? (
|
||||
@@ -262,6 +264,50 @@ export const createContentPageConfig = (
|
||||
);
|
||||
},
|
||||
},
|
||||
// Optional columns - hidden by default
|
||||
{
|
||||
key: 'task_title',
|
||||
label: 'Task Title',
|
||||
sortable: true,
|
||||
sortField: 'task_id',
|
||||
defaultVisible: false,
|
||||
width: '200px',
|
||||
render: (_value: string, row: Content) => (
|
||||
<span className="text-sm text-gray-600 dark:text-gray-400 truncate block max-w-[200px]">
|
||||
{row.task_title || '-'}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'post_url',
|
||||
label: 'Post URL',
|
||||
sortable: false,
|
||||
defaultVisible: false,
|
||||
width: '200px',
|
||||
render: (value: string | null, row: Content) => {
|
||||
const url = value || row.post_url || null;
|
||||
return url ? (
|
||||
<a
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-sm text-brand-600 hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300 truncate block max-w-[200px]"
|
||||
>
|
||||
{url}
|
||||
</a>
|
||||
) : (
|
||||
<span className="text-sm text-gray-400 dark:text-gray-500">-</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'updated_at',
|
||||
label: 'Updated',
|
||||
sortable: true,
|
||||
sortField: 'updated_at',
|
||||
defaultVisible: false,
|
||||
render: (value: string) => formatRelativeDate(value),
|
||||
},
|
||||
],
|
||||
filters: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user