From f19acd400cc5bbe1fe51c004c50ee90d704240d8 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 29 Jan 2026 02:56:44 +0000 Subject: Fix contract type selection --- .../src/components/templates/TemplateEditor.tsx | 31 ++++++++++++++-------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'makima/frontend/src/components/templates') diff --git a/makima/frontend/src/components/templates/TemplateEditor.tsx b/makima/frontend/src/components/templates/TemplateEditor.tsx index 03382f3..c8e1f98 100644 --- a/makima/frontend/src/components/templates/TemplateEditor.tsx +++ b/makima/frontend/src/components/templates/TemplateEditor.tsx @@ -5,9 +5,10 @@ interface Props { template: ContractTemplate; onSave: (template: ContractTemplate) => void; onCancel: () => void; + readOnly?: boolean; } -export function TemplateEditor({ template, onSave, onCancel }: Props) { +export function TemplateEditor({ template, onSave, onCancel, readOnly = false }: Props) { const [editedTemplate, setEditedTemplate] = useState({ ...template, phases: template.phases.map((p) => ({ @@ -106,11 +107,16 @@ export function TemplateEditor({ template, onSave, onCancel }: Props) { {/* Header */}

- Edit Template: {template.name} + {readOnly ? "View" : "Edit"} Template: {template.name}

{template.description}

+ {readOnly && ( +

+ Built-in templates are read-only +

+ )}
{/* Phases */} @@ -127,10 +133,11 @@ export function TemplateEditor({ template, onSave, onCancel }: Props) { handlePhaseNameChange(phase.id, e.target.value)} placeholder="Phase name" + disabled={readOnly} /> {!template.isBuiltIn && ( - + {!readOnly && ( + + )} ); -- cgit v1.2.3