diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 07447bf..73aceae 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -37,7 +37,7 @@ const DialogContent = React.forwardRef< ({ 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" ? ( +