import type { ComponentType } from "react"; import { getComponent, registerComponent } from "../../../registries/components"; import type { FormControl as DefaultFormControl } from "../form-control/FormControl"; import { useOptions } from "./hooks/useOptions"; import { AllSelectProps } from "./Select.interface"; let uuid = 0; export function Select(props: AllSelectProps) { const { className, name = "", id = `field-select-${++uuid}`, label, description = "" } = props; const options = useOptions({ ...props, value: (Array.isArray(props.value) ? props.value : [props.value]) as any }); const FormControl = getComponent("FormControl"); const Component = getComponent>>(["Select." + props.layout, "Select.html5"]); return ( ); } registerComponent("Select", Select);