import type { LunaticComponentProps } from '../type'; import { getComponentErrors } from '../shared/ComponentErrors/ComponentErrors'; import { slottableComponent } from '../shared/HOC/slottableComponent'; import { SimpleLabelRenderer } from './renderer/SimpleLabelRenderer'; import { Combobox } from '../shared/Combobox/Combobox'; import classNames from 'classnames'; import type { LunaticError } from '../../use-lunatic/type'; export function Dropdown({ handleChanges, response, errors, ...props }: LunaticComponentProps<'Dropdown'>) { return ( handleChanges([{ name: response.name, value }])} errors={getComponentErrors(errors, props.id)} /> ); } type CustomProps = Omit< LunaticComponentProps<'Dropdown'>, 'response' | 'handleChanges' | 'errors' > & { onChange: (v: string | null) => void; errors?: LunaticError[]; }; export const CustomDropdown = slottableComponent( 'Dropdown', (props) => { const { id, disabled, options, className, value, declarations, description, label, errors, onChange, readOnly, } = props; return ( ); } );