import { FormControl, useControl } from '@websolutespa/bom-mixer-forms'; import { useLabel } from '@websolutespa/bom-mixer-hooks'; import { ReactNode, useId } from 'react'; import { Field, InputProps, Label } from '../forms'; import { FieldError } from './field-error'; type FieldImplicitProps = InputProps & { control: FormControl; before?: ReactNode; after?: ReactNode; }; export function FieldImplicit({ control, before, after, ...props }: FieldImplicitProps) { const uid = useId(); const label = useLabel(); const uniqueName = `${control.name}-${uid}`; const [state, setValue, setTouched] = useControl(control); const controlLabel = control.label && label(control.label); return ( state.flags.hidden ? ( ) : ( ) ); }