From 3288f766f5936bef831cfd7fb02b38d7740e182d Mon Sep 17 00:00:00 2001 From: Muhammad Fajar Date: Thu, 17 Nov 2022 15:55:55 +0700 Subject: [PATCH] claim reports slicing --- .../src/pages/ClaimReport/Index.tsx | 46 ++++++++ frontend/client-portal/src/routes/index.tsx | 22 +++- .../sections/claim-report/CardClaimStatus.tsx | 102 ++++++++++++++++++ 3 files changed, 167 insertions(+), 3 deletions(-) create mode 100755 frontend/client-portal/src/pages/ClaimReport/Index.tsx create mode 100644 frontend/client-portal/src/sections/claim-report/CardClaimStatus.tsx diff --git a/frontend/client-portal/src/pages/ClaimReport/Index.tsx b/frontend/client-portal/src/pages/ClaimReport/Index.tsx new file mode 100755 index 00000000..d4976342 --- /dev/null +++ b/frontend/client-portal/src/pages/ClaimReport/Index.tsx @@ -0,0 +1,46 @@ +// @mui +import { Card, Container, Grid, TableBody, TableCell, TableRow } from '@mui/material'; +// components +import Page from '../../components/Page'; +// utils +import useSettings from '../../hooks/useSettings'; +// theme +import palette from '../../theme/palette'; +// section +import CardClaimStatus from '../../sections/claim-report/CardClaimStatus'; + +// ---------------------------------------------------------------------- + +const listClaimItems = [ + { name: 'Requested', value: 15, color: palette.dark.primary.dark }, + { name: 'Approval', value: 20, color: palette.dark.warning.dark }, + { name: 'Disbrusment', value: 20, color: palette.dark.success.dark }, + { name: 'Rejected', value: 20, color: palette.dark.error.dark }, +]; + +const testingData = [ + { label: 'Member ID', value: 'member_id' }, + { label: 'Name', value: 'name' }, + { label: 'Divisi', value: 'division_id' }, +]; + +// ---------------------------------------------------------------------- + +export default function Drugs() { + const { themeStretch } = useSettings(); + + return ( + + + + + + + + + + + + + ); +} diff --git a/frontend/client-portal/src/routes/index.tsx b/frontend/client-portal/src/routes/index.tsx index c0f5d182..1d7ae5f4 100755 --- a/frontend/client-portal/src/routes/index.tsx +++ b/frontend/client-portal/src/routes/index.tsx @@ -47,9 +47,6 @@ export default function Router() { ), }, - // { path: 'login-unprotected', element: }, - // { path: 'register-unprotected', element: }, - // { path: 'reset-password', element: }, ], }, { @@ -89,6 +86,22 @@ export default function Router() { }, ], }, + { + path: '/claim-report', + element: ( + + + + + + ), + children: [ + { + element: , + index: true, + }, + ], + }, { path: '*', element: , @@ -114,3 +127,6 @@ const AlarmCenter = Loadable(lazy(() => import('../pages/AlarmCenter/Index'))); const AlarmCenterServiceMonitoring = Loadable( lazy(() => import('../pages/AlarmCenter/ServiceMonitoring')) ); + +// Claim Report +const ClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Index'))); diff --git a/frontend/client-portal/src/sections/claim-report/CardClaimStatus.tsx b/frontend/client-portal/src/sections/claim-report/CardClaimStatus.tsx new file mode 100644 index 00000000..595c1dec --- /dev/null +++ b/frontend/client-portal/src/sections/claim-report/CardClaimStatus.tsx @@ -0,0 +1,102 @@ +// @mui +import { Grid, Card, Typography, Stack } from '@mui/material'; +import { styled } from '@mui/material/styles'; +// theme +import palette from '../../theme/palette'; + +// ---------------------------------------------------------------------- + +interface ClaimStatusType { + name: string; + value: number; + color: string; +} + +interface PropsCardClaimStatus { + data?: ClaimStatusType[]; +} + +// ---------------------------------------------------------------------- + +const RootStyle = styled(Card)(({ theme }) => ({ + boxShadow: 'none', + padding: theme.spacing(2), + color: 'black', + backgroundColor: theme.palette.grey[200], +})); + +// ---------------------------------------------------------------------- + +const defaultData = [ + { name: 'Requested', value: 0, color: palette.dark.primary.dark }, + { name: 'Approval', value: 0, color: palette.dark.warning.dark }, + { name: 'Disbrusment', value: 0, color: palette.dark.success.dark }, + { name: 'Rejected', value: 0, color: palette.dark.error.dark }, +]; + +// ---------------------------------------------------------------------- + +export default function CardClaimStatus({ data }: PropsCardClaimStatus) { + return ( + + + Claim Status + + + {data + ? data.map(({ name, value, color }: ClaimStatusType, key) => ( + + + + {name} + + + {value} + + + Cases + + + + )) + : defaultData.map(({ name, value, color }: ClaimStatusType, key) => ( + + + + {name} + + + {value} + + + Cases + + + + ))} + + + ); +}