import { FieldName } from "@conform-to/react/future"; import { Field, FieldProps } from "../field/Field"; import { SelectHandle, SelectOption } from "./types"; import { useField, useControl } from "@conform-to/react/future"; import { Select } from "./Select"; import { useRef } from "react"; interface Props extends Omit { name: FieldName; placeholder?: string; options: SelectOption[]; } export function SelectField({ name, placeholder, options, id: forcedId, ...rest }: Props) { const controlInputRef = useRef(null); const field = useField(name); const id = forcedId ?? field.id; const control = useControl({ defaultValue: field.defaultValue, onFocus() { controlInputRef.current?.focus(); }, }); return ( <> ); }