From 46a49d77a400f5587a42f7ad60e2167aaafb76fd Mon Sep 17 00:00:00 2001 From: aahnik Date: Wed, 7 May 2025 14:53:31 +0530 Subject: [PATCH 1/2] Update generic-editor.tsx ui to show two coloumn view when datetime fields are present in the schema --- mint/generic-editor.tsx | 266 ++++++++++++++++++++++++++++------------ 1 file changed, 186 insertions(+), 80 deletions(-) diff --git a/mint/generic-editor.tsx b/mint/generic-editor.tsx index ff93bb4..6b0fd92 100644 --- a/mint/generic-editor.tsx +++ b/mint/generic-editor.tsx @@ -118,97 +118,203 @@ export function GenericEditor({ return ( - + f.type === "datetime") ? "w-[1000px]" : "w-[700px]"} rounded-lg`} + > {data ? `Edit ${title}` : `Add New ${title}`}
-
- {fields.map((field) => ( -
- - {field.type === "select" && field.options ? ( - { + const event = { + target: { name: field.name, value }, + }; + register(field.name as any).onChange(event); + }} + defaultValue={ + data?.[field.name as keyof typeof data] as string + } + > + + + + + {field.options.map((option) => ( + + {option.label} + + ))} + + + ) : field.type === "textarea" ? ( +