added imae adn prompt icons on contetn page
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import Badge from '../../components/ui/badge/Badge';
|
||||
import { formatRelativeDate } from '../../utils/date';
|
||||
import { Content } from '../../services/api';
|
||||
import { FileIcon, MoreDotIcon } from '../../icons';
|
||||
|
||||
export interface ColumnConfig {
|
||||
key: string;
|
||||
@@ -194,7 +195,72 @@ export const createContentPageConfig = (
|
||||
sortable: true,
|
||||
sortField: 'generated_at',
|
||||
label: 'Generated',
|
||||
render: (value: string) => formatRelativeDate(value),
|
||||
align: 'right',
|
||||
render: (value: string, row: Content) => {
|
||||
const hasPrompts = row.has_image_prompts || false;
|
||||
const hasImages = row.has_generated_images || false;
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-end gap-3 pr-10">
|
||||
<span className="text-gray-700 dark:text-gray-300 whitespace-nowrap">
|
||||
{formatRelativeDate(value)}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
{/* Prompt Icon */}
|
||||
<div
|
||||
className={`w-5 h-5 flex items-center justify-center flex-shrink-0 ${
|
||||
hasPrompts
|
||||
? 'text-green-500 dark:text-green-400'
|
||||
: 'text-gray-300 dark:text-gray-600'
|
||||
}`}
|
||||
title={hasPrompts ? 'Image prompts generated' : 'No image 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="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
||||
<polyline points="14 2 14 8 20 8" />
|
||||
<line x1="16" y1="13" x2="8" y2="13" />
|
||||
<line x1="16" y1="17" x2="8" y2="17" />
|
||||
<polyline points="10 9 9 9 8 9" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{/* Image 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 generated'}
|
||||
>
|
||||
<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>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
filters: [
|
||||
|
||||
@@ -1517,6 +1517,8 @@ export interface Content {
|
||||
metadata: Record<string, any>;
|
||||
generated_at: string;
|
||||
updated_at: string;
|
||||
has_image_prompts?: boolean;
|
||||
has_generated_images?: boolean;
|
||||
}
|
||||
|
||||
export interface ContentResponse {
|
||||
|
||||
Reference in New Issue
Block a user