refactor(create-filter-modal): add useStates to name and label text-fields
This commit is contained in:
parent
dbea5cbeec
commit
4056719b50
@ -7,6 +7,7 @@ import Autocomplete from '@mui/material/Autocomplete';
|
||||
import { Iconify } from 'src/components/iconify/iconify';
|
||||
|
||||
import { createFiltersAsync, FilterCreateDto, filterTypes, Type } from '../../../api/filter-service';
|
||||
import { useState } from 'react';
|
||||
|
||||
const style = {
|
||||
position: 'absolute',
|
||||
@ -25,6 +26,9 @@ type ModalProps = {
|
||||
}
|
||||
|
||||
export default function CreateFilterModal({ open, handleClose }: ModalProps) {
|
||||
const [name, setName] = useState<string>('');
|
||||
const [label, setLabel] = useState<string>('');
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Modal
|
||||
@ -34,8 +38,8 @@ export default function CreateFilterModal({ open, handleClose }: ModalProps) {
|
||||
aria-describedby="modal-modal-description"
|
||||
>
|
||||
<Box sx={style}>
|
||||
<TextField label="Label" variant="filled" />
|
||||
<TextField label="Name" variant="filled" />
|
||||
<TextField label="Label" variant="filled" value={name} onChange={e => setName(e.target.value)} />
|
||||
<TextField label="Name" variant="filled" value={label} onChange={e => setLabel(e.target.value)} />
|
||||
<Autocomplete
|
||||
disablePortal
|
||||
options={filterTypes}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user