removed derived atom from async cookies atom (#259)
This commit is contained in:
35
frontend/src/components/CustomArgsTextField.tsx
Normal file
35
frontend/src/components/CustomArgsTextField.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { TextField } from '@mui/material'
|
||||
import { useAtom, useAtomValue } from 'jotai'
|
||||
import { customArgsState } from '../atoms/downloadTemplate'
|
||||
import { settingsState } from '../atoms/settings'
|
||||
import { useI18n } from '../hooks/useI18n'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const CustomArgsTextField: React.FC = () => {
|
||||
const { i18n } = useI18n()
|
||||
|
||||
const settings = useAtomValue(settingsState)
|
||||
|
||||
const [customArgs, setCustomArgs] = useAtom(customArgsState)
|
||||
|
||||
useEffect(() => {
|
||||
setCustomArgs('')
|
||||
}, [])
|
||||
|
||||
const handleCustomArgsChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setCustomArgs(e.target.value)
|
||||
}
|
||||
|
||||
return (
|
||||
<TextField
|
||||
fullWidth
|
||||
label={i18n.t('customArgsInput')}
|
||||
variant="outlined"
|
||||
onChange={handleCustomArgsChange}
|
||||
value={customArgs}
|
||||
disabled={settings.formatSelection}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default CustomArgsTextField
|
||||
Reference in New Issue
Block a user