import * as React from "react" import { SelectProps } from "@mui/base/Select" import type { Language } from "../types/Language" import { Select, Option } from "./Select" import { useFetchLanguages } from "../utils/queries" export type SelectLanguageProps = SelectProps<{}, boolean> export const SelectLanguage = React.forwardRef(function SelectLanguage( props: SelectLanguageProps, ref: React.ForwardedRef ) { const id = React.useId() const [options, setOptions] = React.useState(null) const { defaultValue, ...other } = props const { isLoading, data } = useFetchLanguages() React.useEffect(() => { if (data) { setOptions(data) } }, [data]) return ( ) })