diff --git a/frontend/hospital-portal/src/pages/Dashboard.tsx b/frontend/hospital-portal/src/pages/Dashboard.tsx index 23dbe24c..a4468195 100755 --- a/frontend/hospital-portal/src/pages/Dashboard.tsx +++ b/frontend/hospital-portal/src/pages/Dashboard.tsx @@ -16,11 +16,13 @@ import TableList from '@/sections/dashboard/TableList'; // ---------------------------------------------------------------------- +// const [notifications, setNotifications] = useState([]) + const itemList = [ - { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '08:00 WIB' }, - { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '09:00 WIB' }, - { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '10:00 WIB' }, - { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '11:00 WIB' }, + // { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '08:00 WIB' }, + // { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '09:00 WIB' }, + // { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '10:00 WIB' }, + // { info: 'Mohon lengkapi dokumen Mahen sadarsa', date: 'Selasa, 20 April 22', time: '11:00 WIB' }, ]; // ---------------------------------------------------------------------- diff --git a/frontend/hospital-portal/src/sections/dashboard/CardNotification.tsx b/frontend/hospital-portal/src/sections/dashboard/CardNotification.tsx index e44160d0..6ce297c4 100644 --- a/frontend/hospital-portal/src/sections/dashboard/CardNotification.tsx +++ b/frontend/hospital-portal/src/sections/dashboard/CardNotification.tsx @@ -6,6 +6,8 @@ import { ChevronRight } from '@mui/icons-material'; import Iconify from '@/components/Iconify'; // React import { useState } from 'react'; +import DialogNotification from './DialogNotification'; +import DialogDetailClaim from './DialogDetailClaim'; // ---------------------------------------------------------------------- @@ -93,7 +95,7 @@ export default function CardNotification({ data }: NotificationProps) { - {data + {(data && data.length) ? data.map(({ info, date, time }, key) => (
{key >= 1 ? : ''} @@ -116,7 +118,7 @@ export default function CardNotification({ data }: NotificationProps) {
)) - : ''} + : Tidak ada notifikasi}
{isDialog === 'allNotification' && ( diff --git a/frontend/hospital-portal/src/sections/dashboard/DialogDetailClaim.tsx b/frontend/hospital-portal/src/sections/dashboard/DialogDetailClaim.tsx new file mode 100644 index 00000000..3aba83d1 --- /dev/null +++ b/frontend/hospital-portal/src/sections/dashboard/DialogDetailClaim.tsx @@ -0,0 +1,175 @@ +// @mui +import { + Button, + Box, + Stepper, + Step, + StepLabel, + Card, + Typography, + Divider, + Stack, +} from '@mui/material'; +import { Add } from '@mui/icons-material'; +// components +import MuiDialog from '../../components/MuiDialog'; +// theme +import palette from '../../theme/palette'; +// React +import { ReactElement } from 'react'; + +type DataContent = { + info: string; + date: string; + time: string; +}; + +type MuiDialogProps = { + title?: { + name?: string; + icon?: string; + }; + openDialog: boolean; + setOpenDialog: Function; + content?: ReactElement; + data?: DataContent[]; +}; + +const steps = ['Review', 'Approval', 'Disbursement']; + +const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialogProps) => { + const getContent = () => ( + <> + + + Claim Request + + + Submission date + 15 / 05 / 2022 + + + + + {steps.map((label) => ( + + {label} + + ))} + + + + + 17 Mei 2022 + + + + + + {/* Item 1 */} + + + 09:10 WIB + + Approval + + + + + + Details : mohon melengkapi kekurangan dokumen + + + Lab pemeriksaan darah + + + + + {/* Item 2 */} + + + 09:00 WIB + + Approval + + + + + + Details : Penilaian Dokter + + + + {/* Item 3 */} + + + 08:00 WIB + + Review + + + + + + Details : Klaim Diajukan + + + + + + + ); + + return ( + + ); +}; + +export default DialogDetailClaim; diff --git a/frontend/hospital-portal/src/sections/dashboard/DialogNotification.tsx b/frontend/hospital-portal/src/sections/dashboard/DialogNotification.tsx new file mode 100644 index 00000000..c93a27b2 --- /dev/null +++ b/frontend/hospital-portal/src/sections/dashboard/DialogNotification.tsx @@ -0,0 +1,93 @@ +// react +import { ReactElement, useState } from 'react'; +// mui +import { Card, Divider, Link, Stack, Typography } from '@mui/material'; +import { styled } from '@mui/material/styles'; +// Component +import MuiDialog from '../../components/MuiDialog'; +// Sections +import DialogDetailClaim from './DialogDetailClaim'; + +type DataContent = { + info: string; + date: string; + time: string; +}; + +type MuiDialogProps = { + title?: { + name?: string; + icon?: string; + }; + openDialog: boolean; + setOpenDialog: Function; + content?: ReactElement; + data?: DataContent[]; +}; + +const ItemNotificationStyle = styled(Card)(({ theme }) => ({ + boxShadow: 'none', + padding: theme.spacing(1), + borderRadius: 0.5, + color: 'black', +})); + +const DialogNotification = ({ title, openDialog, setOpenDialog, data }: MuiDialogProps) => { + const [openDialogClaim, setOpenDialogClaim] = useState(false); + const [dialogTitleClaim, setDialogTitleClaim] = useState(''); + + const clickHandler = () => { + setDialogTitleClaim('Claim Details'); + setOpenDialogClaim(true); + }; + + const getContent = () => ( + + + {data + ? data.map(({ info, date, time }: DataContent, key) => ( +
+ {key >= 1 ? : ''} + + + {info} + + Info Detail + + + + {date} + {time} + + +
+ )) + : ''} +
+
+ ); + + return ( + <> + + + + + ); +}; + +export default DialogNotification; diff --git a/frontend/hospital-portal/src/sections/dashboard/TableList.tsx b/frontend/hospital-portal/src/sections/dashboard/TableList.tsx index 72ddd2af..49513571 100755 --- a/frontend/hospital-portal/src/sections/dashboard/TableList.tsx +++ b/frontend/hospital-portal/src/sections/dashboard/TableList.tsx @@ -38,6 +38,7 @@ import palette from '@/theme/palette'; import { useSearchParams } from 'react-router-dom'; // import { UserCurrentCorporateContext } from '@/contexts/UserCurrentCorporate'; import { fSplit } from '@/utils/formatNumber'; +import { Chip } from '@mui/material'; /* ---------------------------------- types --------------------------------- */ type PaginationTableProps = { @@ -60,7 +61,7 @@ type DataTableProps = { total: number; percentage: number; }; - status: number; + status: string; }; type Order = 'asc' | 'desc'; @@ -174,7 +175,6 @@ function EnhancedTableHead({ order, orderBy, onRequestSort }: EnhancedTableProps /* -------------------------------------------------------------------------- */ export default function TableList(props: any) { - const [dataTable, setDataTable] = useState([]); const [paginationTable, setPaginationTable] = useState({ current_page: 0, @@ -294,7 +294,7 @@ export default function TableList(props: any) { const response = await axios.get(`/claim-requests`, { params: { ...params, claimMember: false }, }); - + setSearchParams(params); setDataTable(response.data.data.data); setPaginationTable(response.data.data); @@ -365,8 +365,9 @@ export default function TableList(props: any) { {row.code} {row.member?.full_name ?? ''} {row.submission_date} - { row.log_url ? ( - - ) : ( - Belum Tersedia - )} - - - {row.status == 'requested' ? ( - ) : ( - + Belum Tersedia )} - {/* - - - - */} + + + )) ) : (