'use client' import { LegalTemplateResult, LicenseType, TemplateType, TEMPLATE_TYPE_LABELS } from '@/lib/sdk/types' import LicenseBadge from './LicenseBadge' export default function LibraryCard({ template, expanded, onTogglePreview, onUse, }: { template: LegalTemplateResult expanded: boolean onTogglePreview: () => void onUse: () => void }) { const typeLabel = template.templateType ? (TEMPLATE_TYPE_LABELS[template.templateType as TemplateType] || template.templateType) : null const placeholderCount = template.placeholders?.length ?? 0 return (

{template.documentTitle || 'Vorlage'}

{template.language}
{typeLabel && ( {typeLabel} )} {placeholderCount > 0 && ( {placeholderCount} Platzh. )}
{expanded && (
            {template.text}
          
)}
) }