From 15122698a03b2b798bcbb228f7994d5f073e38fc Mon Sep 17 00:00:00 2001 From: akhisud3195 Date: Wed, 19 Feb 2025 17:24:04 +0530 Subject: [PATCH] Refactor components and use in scenarios pages --- .../app/lib/components/editable-field.tsx | 20 +- .../app/lib/components/form-section.tsx | 18 + .../app/lib/components/structured-panel.tsx | 82 +++ .../projects/[projectId]/simulation/app.tsx | 231 +++----- .../simulation/components/RunComponents.tsx | 2 +- .../components/ScenarioComponents.tsx | 276 ++++++--- .../[projectId]/simulation/previous_app.tsx | 536 ++++++++++++++++++ .../projects/[projectId]/workflow/copilot.tsx | 6 +- .../[projectId]/workflow/entity_list.tsx | 6 +- .../projects/[projectId]/workflow/pane.tsx | 85 +-- .../[projectId]/workflow/prompt_config.tsx | 11 +- .../[projectId]/workflow/tool_config.tsx | 14 +- 12 files changed, 953 insertions(+), 334 deletions(-) create mode 100644 apps/rowboat/app/lib/components/form-section.tsx create mode 100644 apps/rowboat/app/lib/components/structured-panel.tsx create mode 100644 apps/rowboat/app/projects/[projectId]/simulation/previous_app.tsx diff --git a/apps/rowboat/app/lib/components/editable-field.tsx b/apps/rowboat/app/lib/components/editable-field.tsx index 66ec34d5..f29b0946 100644 --- a/apps/rowboat/app/lib/components/editable-field.tsx +++ b/apps/rowboat/app/lib/components/editable-field.tsx @@ -19,8 +19,13 @@ interface EditableFieldProps { className?: string; validate?: (value: string) => { valid: boolean; errorMessage?: string }; light?: boolean; +<<<<<<< HEAD mentions?: boolean; mentionsAtValues?: Match[]; +======= + showSaveButton?: boolean; + error?: string | null; +>>>>>>> 0ddd390 (Refactor components and use in scenarios pages) } export function EditableField({ @@ -36,6 +41,8 @@ export function EditableField({ light = false, mentions = false, mentionsAtValues = [], + showSaveButton = multiline, + error, }: EditableFieldProps) { const [isEditing, setIsEditing] = useState(false); const [localValue, setLocalValue] = useState(value); @@ -95,9 +102,9 @@ export function EditableField({ return (
- {(label || isEditing && multiline) &&
+ {(label || isEditing && showSaveButton) &&
{label &&