diff --git a/frontend/client-portal/src/pages/Members/Index.tsx b/frontend/client-portal/src/pages/Members/Index.tsx index d0d9e4d2..016b07d3 100644 --- a/frontend/client-portal/src/pages/Members/Index.tsx +++ b/frontend/client-portal/src/pages/Members/Index.tsx @@ -1,5 +1,5 @@ // @mui -import { Box, Button, Collapse, Container, IconButton, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material'; +import { Box, Button, Card, Collapse, Container, IconButton, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; // hooks @@ -20,21 +20,21 @@ export default function Members() { console.log('Loading Something') } - function createData( - name: string, - calories: number, - fat: number, - carbs: number, - protein: number, - price: number, - ) { + type Member = { + id: number; + code: string; + nik: string; + name: string; + plan_code: string; + number_of_families: number; + number_of_claim: number; + active: boolean; + history?: []; + } + + function createData( member: Member ): Member { return { - name, - calories, - fat, - carbs, - protein, - price, + ...member, history: [ { date: '2020-01-05', @@ -46,8 +46,8 @@ export default function Members() { customerId: 'Anonymous', amount: 1, }, - ], - }; + ] + } } function Row(props: { row: ReturnType }) { @@ -66,13 +66,12 @@ export default function Members() { {open ? : } - - {row.name} - - {row.calories} - {row.fat} - {row.carbs} - {row.protein} + {row.code} + {row.name} + {row.nik} + {row.plan_code} + {row.number_of_claim} + {row.number_of_families} @@ -91,18 +90,24 @@ export default function Members() { - {row.history.map((historyRow) => ( - + {row.history ? row.history.map((historyRow) => ( + - {historyRow.date} + {historyRow?.date} - {historyRow.customerId} - {historyRow.amount} + {historyRow?.customerId} + {historyRow?.amount} - {Math.round(historyRow.amount * row.price * 100) / 100} + {Math.round(historyRow?.amount * row.price * 100) / 100} - ))} + )) + : ( + + No Data + + ) + } @@ -115,13 +120,22 @@ export default function Members() { // Dummy Default Data const rows = [ - createData('Frozen yoghurt', 159, 6.0, 24, 4.0, 3.99), - createData('Ice cream sandwich', 237, 9.0, 37, 4.3, 4.99), - createData('Eclair', 262, 16.0, 24, 6.0, 3.79), - createData('Cupcake', 305, 3.7, 67, 4.3, 2.5), - createData('Gingerbread', 356, 16.0, 49, 3.9, 1.5), + createData({ + id: 1, + code: 'MEMBERCODE', + nik: 'SM12310003', + name: 'Dede Pardede', + plan_code: 'PLAN001', + number_of_families: 4, + number_of_claim: 0, + active: true, + }) ]; + const headStyle = { + fontWeight: 'bold', + }; + return ( @@ -134,18 +148,21 @@ export default function Members() { Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat, delectus? Suscipit placeat tempora mollitia optio, assumenda maiores architecto officia itaque molestias cum id eligendi necessitatibus! A velit eos ratione ullam. + - + - - Dessert (100g serving) - Calories - Fat (g) - Carbs (g) - Protein (g) + Detail + MemberID + Name + NIK + PlanID + Claim (time) + Family (person) + Status - + {rows.map((row, index) => ( @@ -153,6 +170,7 @@ export default function Members() {
+
); diff --git a/package.json b/package.json index 051caf03..4544496b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "devDependencies": { "axios": "^0.25", "laravel-mix": "^6.0.6", - "lodash": "^4.17.19", + "lodash": "^4.17.21", "postcss": "^8.1.14" }, "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a169450..b620ff39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ specifiers: '@mui/material': ^5.8.1 axios: ^0.25 laravel-mix: ^6.0.6 - lodash: ^4.17.19 + lodash: ^4.17.21 postcss: ^8.1.14 dependencies: