// @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'; // React import { useState } from 'react'; import DialogNotification from './DialogNotification'; import DialogDetailClaim from '@/components/dialogs/DialogDetailClaim'; // ---------------------------------------------------------------------- type DataContent = { info: string; date: string; time: string; }; type NotificationProps = { data?: DataContent[]; }; // ---------------------------------------------------------------------- const RootNotificationStyle = styled(Card)(({ theme }) => ({ boxShadow: 'none', padding: '1rem 0.5rem', color: 'black', backgroundColor: theme.palette.grey[200], // maxHeight: '240px', })); const ItemNotificationStyle = styled(Card)(({ theme }) => ({ boxShadow: 'none', padding: theme.spacing(1), borderRadius: 0.5, color: 'black', })); // ---------------------------------------------------------------------- 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.length) ? data.map(({ info, date, time }, key) => (
{key >= 1 ? : ''} {info} clickHandler('infoDetail')} > Info Detail {date} {time}
)) : Tidak ada notifikasi}
{isDialog === 'allNotification' && ( )} {isDialog === 'infoDetail' && ( )}
); }