"use client"; import Image from "next/image"; import RuleCard from "../RuleCard"; import type { RuleCardProps } from "../RuleCard/RuleCard.types"; import { getAssetPath } from "../../../../lib/assetUtils"; import type { RuleTemplateDto } from "../../../../lib/create/fetchTemplates"; import { templateBodyToCategories, templateSummaryFromBody, } from "../../../../lib/create/templateReviewMapping"; import { getGovernanceTemplateCatalogEntry, } from "../../../../lib/templates/governanceTemplateCatalog"; import { TEMPLATE_GRID_FALLBACK_PRESENTATION } from "../../../../lib/templates/templateGridPresentation"; export interface TemplateReviewCardProps { template: RuleTemplateDto; /** Merged onto RuleCard `className` (e.g. final-review desktop vs mobile radius/padding). */ ruleCardClassName?: string; /** RuleCard size; create-flow passes `L` at/above `md`, `M` below (640px). */ size?: RuleCardProps["size"]; } /** * Expanded RuleCard for template review: surfaces + icon from Figma catalog (21764-16435); * tag rows from API `body`. */ export function TemplateReviewCard({ template, ruleCardClassName = "", size = "L", }: TemplateReviewCardProps) { const catalog = getGovernanceTemplateCatalogEntry(template.slug); const pres = catalog ?? TEMPLATE_GRID_FALLBACK_PRESENTATION; const categories = templateBodyToCategories(template.body); const summary = templateSummaryFromBody(template.description, template.body); return ( {}} icon={ {template.title} } /> ); }