This commit is contained in:
alorig
2025-12-01 04:31:13 +05:00
parent a95aa8f17c
commit 34d2b3abf9
3 changed files with 80 additions and 1 deletions

View File

@@ -111,6 +111,40 @@ export function createPublishedPageConfig(params: {
);
},
},
{
key: 'wordpress_status',
label: 'WP Status',
sortable: false,
width: '120px',
render: (_value: any, row: Content) => {
// Check if content has been published to WordPress
if (!row.external_id) {
return (
<Badge color="gray" size="xs" variant="soft">
<span className="text-[11px] font-normal">Not Published</span>
</Badge>
);
}
// WordPress status badge - use external_status if available, otherwise show 'Published'
const wpStatus = (row as any).wordpress_status || 'publish';
const statusConfig: Record<string, { color: 'success' | 'amber' | 'blue' | 'gray' | 'red'; label: string }> = {
publish: { color: 'success', label: 'Published' },
draft: { color: 'gray', label: 'Draft' },
pending: { color: 'amber', label: 'Pending' },
future: { color: 'blue', label: 'Scheduled' },
private: { color: 'amber', label: 'Private' },
trash: { color: 'red', label: 'Trashed' },
};
const config = statusConfig[wpStatus] || { color: 'success' as const, label: 'Published' };
return (
<Badge color={config.color} size="xs" variant="soft">
<span className="text-[11px] font-normal">{config.label}</span>
</Badge>
);
},
},
{
key: 'content_type',