import { Autocomplete, Box, TextField, Typography } from '@mui/material' import { customArgsState, savedTemplatesState } from '../atoms/downloadTemplate' import { useI18n } from '../hooks/useI18n' import { useAtom, useAtomValue } from 'jotai' const ExtraDownloadOptions: React.FC = () => { const { i18n } = useI18n() const customTemplates = useAtomValue(savedTemplatesState) const [, setCustomArgs] = useAtom(customArgsState) return ( <> ({ label: name, content }))} autoHighlight defaultValue={ customTemplates .filter(({ id, name }) => id === "0" || name === "default") .map(({ name, content }) => ({ label: name, content })) .at(0) } getOptionLabel={(option) => option.label} onChange={(_, value) => { setCustomArgs(value?.content!) }} renderOption={(props, option) => ( {option.label} {option.content} )} sx={{ width: '100%', mt: 2 }} renderInput={(params) => } /> ) } export default ExtraDownloadOptions