import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Button, Drawer, IconButton, List, ListItem, ListItemText, Toolbar, Typography, } from '@mui/material'; import { makeStyles } from '@mui/styles'; import DeleteIcon from '@mui/icons-material/Delete'; import { useTranslation } from '../common/components/LocalizationProvider'; import { eventsActions } from '../store'; const useStyles = makeStyles((theme) => ({ drawer: { width: theme.dimensions.eventsDrawerWidth, }, header: { flexGrow: 1, }, })); const EventsDrawer = ({ open, onClose }) => { const classes = useStyles(); const dispatch = useDispatch(); const t = useTranslation(); const events = useSelector((state) => state.events.items); return ( {t('reportEvents')} {events.map((event) => ( dispatch(eventsActions.delete(event))}> ))} ); }; export default EventsDrawer;