'use client' import { CATEGORIES, EmailTemplate, STATUS_BADGE } from '../_types' interface TemplateCardProps { template: EmailTemplate onEdit: () => void } export function TemplateCard({ template, onEdit }: TemplateCardProps) { const cat = CATEGORIES[template.category] || CATEGORIES.general const version = template.latest_version const status = version ? (STATUS_BADGE[version.status] || STATUS_BADGE.draft) : STATUS_BADGE.draft return (

{template.name}

{cat.label}
{status.label}
{template.description && (

{template.description}

)}
{(template.variables || []).slice(0, 4).map(v => ( {`{{${v}}}`} ))} {(template.variables || []).length > 4 && ( +{template.variables.length - 4} )}
{version && (
v{version.version} · {version.created_at ? new Date(version.created_at).toLocaleDateString('de-DE') : ''}
)}
) }