import { FieldComponent } from '../../form/types'
import { RawSelectField } from './RawSelectField'
import { useSelectOptions } from './use-select-options'

export const SelectField: FieldComponent<string, Record<string, never>> = (props) => {
  const [options, isLoading] = useSelectOptions(props.variable)
  return <RawSelectField options={options} isLoading={isLoading} {...props} />
}
