@@ -207,7 +207,65 @@ export const createContentPageConfig = (
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Removed the separate status icon column. Status icon will be shown in the Created column below.
|
{
|
||||||
|
key: 'content_status_indicators',
|
||||||
|
label: 'Status',
|
||||||
|
sortable: false,
|
||||||
|
width: '100px',
|
||||||
|
align: 'center' as const,
|
||||||
|
render: (_value: any, row: Content) => {
|
||||||
|
const hasPrompts = row.has_image_prompts || false;
|
||||||
|
const hasImages = row.has_generated_images || false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex items-center justify-center gap-2">
|
||||||
|
{/* Prompts Icon */}
|
||||||
|
<div
|
||||||
|
className={`w-5 h-5 flex items-center justify-center flex-shrink-0 ${
|
||||||
|
hasPrompts ? 'text-purple-500 dark:text-purple-400' : 'text-gray-300 dark:text-gray-600'
|
||||||
|
}`}
|
||||||
|
title={hasPrompts ? 'Prompts ready' : 'No prompts'}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
className="w-4 h-4"
|
||||||
|
>
|
||||||
|
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Images Icon */}
|
||||||
|
<div
|
||||||
|
className={`w-5 h-5 flex items-center justify-center flex-shrink-0 ${
|
||||||
|
hasImages ? 'text-green-500 dark:text-green-400' : 'text-gray-300 dark:text-gray-600'
|
||||||
|
}`}
|
||||||
|
title={hasImages ? 'Images generated' : 'No images'}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
className="w-4 h-4"
|
||||||
|
>
|
||||||
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
||||||
|
<circle cx="8.5" cy="8.5" r="1.5" />
|
||||||
|
<polyline points="21 15 16 10 5 21" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'source',
|
key: 'source',
|
||||||
label: 'Source',
|
label: 'Source',
|
||||||
@@ -260,38 +318,18 @@ export const createContentPageConfig = (
|
|||||||
label: 'Created',
|
label: 'Created',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
render: (value: string, row: Content) => {
|
render: (value: string, row: Content) => {
|
||||||
// Image status logic: pending (prompt exists, no image), generated, failed
|
const hasImages = row.has_generated_images || false;
|
||||||
let status = null;
|
|
||||||
if (row.image_status === 'failed') {
|
|
||||||
status = 'failed';
|
|
||||||
} else if (row.image_status === 'generated' || row.has_generated_images) {
|
|
||||||
status = 'generated';
|
|
||||||
} else if (row.has_image_prompts) {
|
|
||||||
status = 'pending';
|
|
||||||
}
|
|
||||||
|
|
||||||
const statusColors: Record<string, string> = {
|
|
||||||
'pending': 'text-amber-500 dark:text-amber-400',
|
|
||||||
'generated': 'text-green-500 dark:text-green-400',
|
|
||||||
'failed': 'text-red-500 dark:text-red-400',
|
|
||||||
};
|
|
||||||
const statusTitles: Record<string, string> = {
|
|
||||||
'pending': 'Images pending',
|
|
||||||
'generated': 'Images generated',
|
|
||||||
'failed': 'Image generation failed',
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-end gap-3 pr-10">
|
<div className="flex items-center justify-end gap-3 pr-10">
|
||||||
<span className="text-gray-700 dark:text-gray-300 whitespace-nowrap">
|
<span className="text-gray-700 dark:text-gray-300 whitespace-nowrap">
|
||||||
{formatRelativeDate(value)}
|
{formatRelativeDate(value)}
|
||||||
</span>
|
</span>
|
||||||
{status && (
|
{hasImages && (
|
||||||
<div
|
<div
|
||||||
className={`w-5 h-5 flex items-center justify-center flex-shrink-0 ${statusColors[status]}`}
|
className="w-5 h-5 flex items-center justify-center flex-shrink-0 text-green-500 dark:text-green-400"
|
||||||
title={statusTitles[status]}
|
title="Images generated"
|
||||||
>
|
>
|
||||||
{/* Single icon for all statuses */}
|
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|||||||
Reference in New Issue
Block a user