import type { BaseFormBuilderProps, GenericFormElementProps, } from "@components/Form/DynamicForm.js"; import { Input } from "@components/UI/Input.js"; import type { LucideIcon } from "lucide-react"; import { Controller, type FieldValues } from "react-hook-form"; export interface InputFieldProps extends BaseFormBuilderProps { type: "text" | "number" | "password"; properties?: { prefix?: string; suffix?: string; step?: number; action?: { icon: LucideIcon; onClick: () => void; }; }; } export function GenericInput({ control, disabled, field, }: GenericFormElementProps>) { return ( ( onChange( field.type === "number" ? Number.parseFloat(e.target.value) : e.target.value, ) } {...field.properties} {...rest} disabled={disabled} /> )} /> ); }