import {Drawer, Box, Icon, Typography} from '@mui/material/'; import useMediaQuery from '@mui/material/useMediaQuery'; import { useReadNotificationsMutation, NotificationEntity, } from '../../generated/graphql'; import CardNotification from './CardNotification'; import DrawerHeader from './DrawerHeader'; import {useTranslation} from 'next-i18next'; interface Props { isOpen: boolean; onClose: () => void; notifications: NotificationEntity[]; } const DrawerContent = ({isOpen, onClose, notifications}: Props) => { const isMobile = useMediaQuery('(max-width:400px)'); const {t} = useTranslation(); const hasNotifications = notifications.length > 0; const [readNotifications] = useReadNotificationsMutation(); const isAllRead = notifications.every( notification => notification.attributes.read ); const markAllRead = () => readNotifications({refetchQueries: ['UserNotifications']}); return ( {hasNotifications ? ( notifications.map(notification => ( )) ) : ( inbox {t`notifications.content`} )} ); }; export default DrawerContent;