trash models added, first attempt for remainign issues
This commit is contained in:
@@ -1068,47 +1068,94 @@ export default function ContentViewTemplate({ content, loading, onBack }: Conten
|
||||
{/* Action Buttons - Conditional based on status */}
|
||||
{content.status && (
|
||||
<div className="px-8 py-6 bg-gray-50 dark:bg-gray-900/30 border-b border-gray-200 dark:border-gray-700">
|
||||
<div className="flex items-center gap-4">
|
||||
{/* Draft status: Show Edit Content + Generate Images */}
|
||||
{content.status.toLowerCase() === 'draft' && (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={() => navigate(`/sites/${content.site_id}/posts/${content.id}/edit`)}
|
||||
startIcon={<PencilIcon className="w-4 h-4" />}
|
||||
>
|
||||
Edit Content
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
tone="brand"
|
||||
onClick={() => navigate(`/writer/images?contentId=${content.id}`)}
|
||||
startIcon={<ImageIcon className="w-4 h-4" />}
|
||||
>
|
||||
Generate Images
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
<div className="flex items-center justify-between flex-wrap gap-4">
|
||||
<div className="flex items-center gap-4">
|
||||
{/* Draft status: Show Edit Content + Generate Images */}
|
||||
{content.status.toLowerCase() === 'draft' && (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={() => navigate(`/sites/${content.site_id}/posts/${content.id}/edit`)}
|
||||
startIcon={<PencilIcon className="w-4 h-4" />}
|
||||
>
|
||||
Edit Content
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
tone="brand"
|
||||
onClick={() => navigate(`/writer/images?contentId=${content.id}`)}
|
||||
startIcon={<ImageIcon className="w-4 h-4" />}
|
||||
>
|
||||
Generate Images
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Review status: Show Edit Content + Publish */}
|
||||
{content.status.toLowerCase() === 'review' && (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={() => navigate(`/sites/${content.site_id}/posts/${content.id}/edit`)}
|
||||
startIcon={<PencilIcon className="w-4 h-4" />}
|
||||
>
|
||||
Edit Content
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
tone="brand"
|
||||
onClick={() => navigate(`/writer/published?contentId=${content.id}&action=publish`)}
|
||||
startIcon={<BoltIcon className="w-4 h-4" />}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Review status: Show Edit Content + Publish */}
|
||||
{content.status.toLowerCase() === 'review' && (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={() => navigate(`/sites/${content.site_id}/posts/${content.id}/edit`)}
|
||||
startIcon={<PencilIcon className="w-4 h-4" />}
|
||||
>
|
||||
Edit Content
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
tone="brand"
|
||||
onClick={() => navigate(`/writer/published?contentId=${content.id}&action=publish`)}
|
||||
startIcon={<BoltIcon className="w-4 h-4" />}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
</>
|
||||
{/* Publishing Status Display */}
|
||||
{content.site_status && (
|
||||
<div className="flex items-center gap-3 px-4 py-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700">
|
||||
<div className="flex items-center gap-2">
|
||||
{content.site_status === 'published' && (
|
||||
<CheckCircleIcon className="w-5 h-5 text-success-500" />
|
||||
)}
|
||||
{content.site_status === 'scheduled' && (
|
||||
<ClockIcon className="w-5 h-5 text-brand-500" />
|
||||
)}
|
||||
{content.site_status === 'publishing' && (
|
||||
<ClockIcon className="w-5 h-5 text-warning-500 animate-pulse" />
|
||||
)}
|
||||
{content.site_status === 'failed' && (
|
||||
<XCircleIcon className="w-5 h-5 text-error-500" />
|
||||
)}
|
||||
{content.site_status === 'not_published' && (
|
||||
<FileTextIcon className="w-5 h-5 text-gray-400" />
|
||||
)}
|
||||
<span className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{content.site_status === 'not_published' && 'Not Published'}
|
||||
{content.site_status === 'scheduled' && 'Scheduled'}
|
||||
{content.site_status === 'publishing' && 'Publishing...'}
|
||||
{content.site_status === 'published' && 'Published'}
|
||||
{content.site_status === 'failed' && 'Failed'}
|
||||
</span>
|
||||
</div>
|
||||
{content.scheduled_publish_at && content.site_status === 'scheduled' && (
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400">
|
||||
{formatDate(content.scheduled_publish_at)}
|
||||
</span>
|
||||
)}
|
||||
{content.external_url && content.site_status === 'published' && (
|
||||
<a
|
||||
href={content.external_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-sm text-brand-600 hover:text-brand-700 dark:text-brand-400"
|
||||
>
|
||||
View on site →
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user