// @mui import { styled } from '@mui/material/styles'; import { Button, Card, Typography, Link, Divider, Stack } from '@mui/material'; import { ChevronRight } from '@mui/icons-material'; // components import Iconify from '../../components/Iconify'; // Section import DialogNotification from './DialogNotification'; import DialogDetailClaim from './DialogDetailClaim'; // React import { useState } from 'react'; // ---------------------------------------------------------------------- type DataContent = { info: string; date: string; time: string; }; type NotificationProps = { data?: DataContent[]; }; // ---------------------------------------------------------------------- const RootNotificationStyle = styled(Card)(({ theme }) => ({ boxShadow: 'none', padding: '1.5rem', color: 'black', backgroundColor: theme.palette.grey[200], height: '100%', maxHeight: '240px', })); const ItemNotificationStyle = styled(Card)(({ theme }) => ({ boxShadow: 'none', padding: theme.spacing(1), borderRadius: 0.5, color: 'black', marginTop: 2, overflowY: 'auto', maxHeight: '154px', gap: '0.5rem', })); // ---------------------------------------------------------------------- export default function CardNotification({ data }: NotificationProps) { const [openDialog, setOpenDialog] = useState(false); const [dialogTitle, setDialogTitle] = useState(''); const [isDialog, setIsDialog] = useState(''); const clickHandler = (isDialog: string) => { switch (isDialog) { case 'allNotification': setDialogTitle('Notification'); setIsDialog(isDialog); setOpenDialog(true); break; case 'infoDetail': setDialogTitle('Claim Details'); setIsDialog(isDialog); setOpenDialog(true); break; default: break; } }; return ( Notification {data ? data.map(({ info, date, time }, index) => (
{index >= 1 ? : ''} {info} clickHandler('infoDetail')} > Info Detail {date} {time}
)) : ''}
{isDialog === 'allNotification' && ( )} {isDialog === 'infoDetail' && ( )}
); }