"use client"; import { TemplateCategory } from "@/types/quickstart"; interface TemplateCardProps { template: { id: string; name: string; description: string; icon: string; category: TemplateCategory; tags: string[]; }; nodeCount: number; previewImage?: string; hoverImage?: string; isLoading?: boolean; onUseWorkflow: () => void; disabled?: boolean; } const CATEGORY_LABELS: Record = { simple: "Simple", advanced: "Advanced", community: "Community", }; const CATEGORY_COLORS: Record = { simple: "bg-blue-500/20 text-blue-300", advanced: "bg-purple-500/20 text-purple-300", community: "bg-amber-500/20 text-amber-300", }; export function TemplateCard({ template, nodeCount, previewImage, hoverImage, isLoading = false, onUseWorkflow, disabled = false, }: TemplateCardProps) { return (
{/* Thumbnail - Left side (square) */}
{previewImage ? ( <> {/* Primary image */} {/* eslint-disable-next-line @next/next/no-img-element */} {`${template.name} {/* Hover image (if provided) */} {hoverImage && ( /* eslint-disable-next-line @next/next/no-img-element */ {`${template.name} )} ) : (
)}
{/* Content - Right side */}
{/* Header row */}

{template.name}

{CATEGORY_LABELS[template.category]}
{/* Description */}

{template.description}

{/* Provider tags and node count */}
{template.tags.map((tag) => ( {tag} ))} {nodeCount} nodes
{/* Action row */}
); }