From 19fde445fef0ef0e4d5d72a80845b9af7a1e0d9f Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 13 Mar 2026 02:10:25 -0400 Subject: [PATCH] feat: add TemplateCard component Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/scripts/TemplateCard.tsx | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 frontend/src/components/scripts/TemplateCard.tsx diff --git a/frontend/src/components/scripts/TemplateCard.tsx b/frontend/src/components/scripts/TemplateCard.tsx new file mode 100644 index 00000000..3b5d8931 --- /dev/null +++ b/frontend/src/components/scripts/TemplateCard.tsx @@ -0,0 +1,72 @@ +import { ShieldAlert } from 'lucide-react' +import { cn } from '@/lib/utils' +import { useScriptGeneratorStore } from '@/store/scriptGeneratorStore' +import type { ScriptTemplateListItem } from '@/types' + +const COMPLEXITY_CLASSES: Record = { + beginner: 'text-emerald-400 bg-emerald-400/10', + intermediate: 'text-amber-400 bg-amber-400/10', + advanced: 'text-rose-500 bg-rose-500/10', +} + +interface Props { + template: ScriptTemplateListItem +} + +export function TemplateCard({ template }: Props) { + const selectedTemplate = useScriptGeneratorStore(s => s.selectedTemplate) + const selectTemplate = useScriptGeneratorStore(s => s.selectTemplate) + const isActive = selectedTemplate?.id === template.id + + return ( + + ) +}