import React from 'react'; import { Link } from 'react-router-dom'; // material-ui import { useTheme } from '@mui/material/styles'; import { Avatar, Box, Button, ButtonBase, CardActions, Chip, ClickAwayListener, Divider, Grid, Paper, Popper, Stack, TextField, Typography, useMediaQuery } from '@mui/material'; // third-party import PerfectScrollbar from 'react-perfect-scrollbar'; // project imports import MainCard from 'ui-component/cards/MainCard'; import Transitions from 'ui-component/extended/Transitions'; import NotificationList from './NotificationList'; // assets import { IconBell } from '@tabler/icons'; // notification status options const status = [ { value: 'all', label: 'All Notification' }, { value: 'new', label: 'New' }, { value: 'unread', label: 'Unread' }, { value: 'other', label: 'Other' } ]; // ==============================|| NOTIFICATION ||============================== // const NotificationSection = () => { const theme = useTheme(); const matchesXs = useMediaQuery(theme.breakpoints.down('md')); const [open, setOpen] = React.useState(false); const [value, setValue] = React.useState(''); /** * anchorRef is used on different componets and specifying one type leads to other components throwing an error * */ const anchorRef = React.useRef(null); const handleToggle = () => { setOpen((prevOpen) => !prevOpen); }; const handleClose = (event: React.MouseEvent | MouseEvent | TouchEvent) => { if (anchorRef.current && anchorRef.current.contains(event.target)) { return; } setOpen(false); }; const prevOpen = React.useRef(open); React.useEffect(() => { if (prevOpen.current === true && open === false) { anchorRef.current.focus(); } prevOpen.current = open; }, [open]); const handleChange = (event: React.ChangeEvent | undefined) => { event?.target.value && setValue(event?.target.value); }; return ( <> {({ TransitionProps }) => ( All Notification Mark as all read {status.map((option) => ( ))} )} ); }; export default NotificationSection;