index.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import MenuList from '@mui/material/MenuList';
  2. import MenuItem from '@mui/material/MenuItem';
  3. import ListItemText from '@mui/material/ListItemText';
  4. import ListItemIcon from '@mui/material/ListItemIcon';
  5. import PhotoSizeSelectActualIcon from '@mui/icons-material/PhotoSizeSelectActual';
  6. import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
  7. import { makeStyles } from '@material-ui/core'
  8. const useStyles = makeStyles({
  9. list: {
  10. background: '#fdfdfd',
  11. },
  12. listIcon: {
  13. marginRight: 15,
  14. },
  15. })
  16. interface IFilesMenu {
  17. setIsOpenMenu: any
  18. }
  19. const FilesMenu = ({setIsOpenMenu}:IFilesMenu) => {
  20. const classes = useStyles()
  21. const handleClose = (i: number) => {
  22. console.log(i, 'index of type file')
  23. setIsOpenMenu(false)
  24. }
  25. return (
  26. <MenuList className={classes.list}>
  27. <MenuItem onClick={() => handleClose(0)}>
  28. <ListItemIcon className={classes.listIcon}>
  29. <PhotoSizeSelectActualIcon fontSize="medium" />
  30. </ListItemIcon>
  31. <ListItemText>Photo or Video</ListItemText>
  32. </MenuItem>
  33. <MenuItem onClick={() => handleClose(1)}>
  34. <ListItemIcon className={classes.listIcon}>
  35. <InsertDriveFileIcon fontSize="medium" />
  36. </ListItemIcon>
  37. <ListItemText>File</ListItemText>
  38. </MenuItem>
  39. </MenuList>
  40. );
  41. }
  42. export default FilesMenu