diff options
Diffstat (limited to 'client/src/components/Dashboard.tsx')
-rw-r--r-- | client/src/components/Dashboard.tsx | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/client/src/components/Dashboard.tsx b/client/src/components/Dashboard.tsx new file mode 100644 index 0000000..20758fc --- /dev/null +++ b/client/src/components/Dashboard.tsx @@ -0,0 +1,60 @@ +import React, { useMemo } from 'react'; +import { useOutletContext } from 'react-router-dom'; +import { + MaterialReactTable, + useMaterialReactTable, + type MRT_ColumnDef, +} from 'material-react-table'; +import type { Guest } from '../slices/api/adminSlice'; + +function Dashboard() { + const guests: Guest[] = useOutletContext(); + const columns = useMemo<MRT_ColumnDef<Guest>[]>( + () => [ + { + accessorKey: 'firstName', + header: 'First Name', + size: 150, + }, + { + accessorKey: 'lastName', + header: 'Last Name', + size: 150, + }, + { + accessorKey: 'attendance', + header: 'Attendance', + size: 50, + }, + { + accessorKey: 'email', + header: 'Email', + size: 150, + }, + { + accessorKey: 'message', + header: 'Message', + size: 200, + }, + { + accessorKey: 'partySize', + header: 'Party Size', + size: 50, + }, + // { + // accessorKey: 'partyList', + // header: 'Party List', + // size: 150, + // }, + ], + [] + ); + const table = useMaterialReactTable({ + columns, + data: guests, + }); + + return <MaterialReactTable table={table} />; +} + +export default Dashboard; |