"use client"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Check, X, Play } from "lucide-react"; interface Asset { id: string; type: string; platform?: string | null; format?: string | null; fileName: string; filePath: string; dimensions?: string | null; metadata?: string | null; status: string; campaign?: { name: string }; } interface AssetCardProps { asset: Asset; onStatusChange: (id: string, status: string) => void; selected?: boolean; onSelect?: (id: string) => void; } export function AssetCard({ asset, onStatusChange, selected, onSelect, }: AssetCardProps) { const metadata = asset.metadata ? JSON.parse(asset.metadata) : {}; const isImage = asset.type === "image" || asset.format === "png" || asset.format === "jpg"; const isVideo = asset.type === "video" || asset.format === "mp4"; const fileSrc = `/api/files/${asset.filePath}`; const pathLower = asset.filePath.toLowerCase(); const source = pathLower.includes("/gemini/") ? "Gemini" : pathLower.includes("/posters/") ? "Canvas Design" : isVideo ? "Remotion" : isImage ? "Playwright" : null; const sourceColors: Record = { Gemini: "text-purple-600 border-purple-200 bg-purple-50", "Canvas Design": "text-amber-600 border-amber-200 bg-amber-50", Remotion: "text-blue-600 border-blue-200 bg-blue-50", Playwright: "text-emerald-600 border-emerald-200 bg-emerald-50", }; return (
{/* Preview */}
onSelect?.(asset.id)} > {isImage && ( e.stopPropagation()} > {asset.fileName} )} {isVideo && ( <>
{/* Info */}
{source && ( {source} )} {asset.platform && ( {asset.platform} )} {asset.dimensions && ( {asset.dimensions} )} {asset.status}
{metadata.caption && (

{metadata.caption}

)} {asset.campaign && (

{asset.campaign.name}

)} {/* Actions — only for images and videos */} {(isImage || isVideo) ? (
) : (

Auto-accepted

)}
); }