index.tsx 1008 B

12345678910111213141516171819202122232425262728293031323334
  1. import Stack from '@mui/material/Stack';
  2. import IconButton from '@mui/material/IconButton';
  3. import SearchIcon from '@mui/icons-material/Search';
  4. import { makeStyles } from '@material-ui/core'
  5. import { useDispatch } from 'react-redux';
  6. import { useState } from 'react';
  7. import MenuList from './MenuList'
  8. import DeleteModal from './DeleteModal';
  9. import { actionIsOpen } from '../../../../../redux/control/action'
  10. const useStyles = makeStyles({
  11. container: {
  12. marginLeft:20
  13. },
  14. })
  15. const Buttons = () => {
  16. const classes = useStyles()
  17. const dispatch = useDispatch()
  18. const [modal,setModal] = useState<boolean>(false)
  19. return (
  20. <Stack className={classes.container} direction="row" spacing={1}>
  21. <IconButton onClick={() => dispatch(actionIsOpen('search'))} aria-label="delete" size="medium">
  22. <SearchIcon fontSize='medium'/>
  23. </IconButton>
  24. <MenuList setModal={setModal}/>
  25. {modal&&<DeleteModal setModal={setModal}/>}
  26. </Stack>
  27. );
  28. }
  29. export default Buttons