diff --git a/client/app/admin-dashboard/page.jsx b/client/app/admin-dashboard/page.jsx new file mode 100644 index 0000000..f26a385 --- /dev/null +++ b/client/app/admin-dashboard/page.jsx @@ -0,0 +1,9 @@ +import AdminDashboard from "../../components/AdminDashboard"; + +export default function AdminDashboardView() { + return ( +
+ +
+ ); +} diff --git a/client/app/page.js b/client/app/page.js index 3f1a00a..ab60fd8 100644 --- a/client/app/page.js +++ b/client/app/page.js @@ -1,3 +1,4 @@ +"use client"; import { Container, Typography } from "@mui/material"; export default function Home() { diff --git a/client/components/AdminDashboard.jsx b/client/components/AdminDashboard.jsx new file mode 100644 index 0000000..2028920 --- /dev/null +++ b/client/components/AdminDashboard.jsx @@ -0,0 +1,107 @@ +"use client"; +import React, { useState } from "react"; +import { DataGrid } from "@mui/x-data-grid"; +import { Typography } from "@mui/material"; +import Button from "@mui/material/Button"; + +export default function AdminDashboard() { + const status_options = ["Requested", "Confirmed", "Pending", "Visited"]; + + const [rows, setRows] = useState([ + { + id: 1, + visited: false, + status: "Confirmed", + date: "11/15/24", + time: "6a-8a", + lastname: "Targaryen", + firstname: "Daenerys", + phone: "333-333-3333", + email: "iConquor@westeros.com", + address: "333 Dothraki Valley, Free City of Penthos, Valerya 33333", + }, + { + id: 2, + visited: false, + status: "Pending", + date: "12/3/24", + time: "2p-4p", + lastname: "Lannister", + firstname: "Tyrion", + phone: "031-294-4822", + email: "iDrink@andKnowThings.com", + address: "699 Hand of the King Row, Here and There, Seven Kingdoms 00000", + }, + { + id: 3, + visited: false, + status: "Requested", + date: "12/24/24", + time: "11a-1p", + lastname: "Stark", + firstname: "Arya", + phone: "909-485-3822", + email: "aGirl@IsNoOne.com", + address: "39842 Northern Way, Many Faced God, Esos 10101", + }, + ]); + + const columns = [ + { + field: "visited", + headerName: "Mark as visited", + width: 150, + renderCell: (params) => ( + + ), + }, + { field: "status", headerName: "Status", width: 150 }, + { field: "date", headerName: "Date", width: 150 }, + { field: "time", headerName: "Timeslot", width: 150 }, + { field: "lastname", headerName: "Last Name", width: 150 }, + { field: "firstname", headerName: "First Name", width: 150 }, + { field: "phone", headerName: "Phone", width: 150 }, + { field: "email", headerName: "Email", width: 150 }, + { field: "address", headerName: "Address", width: 150 }, + ]; + + const handleVisited = (id) => { + setRows((prev) => + prev.map((row) => + row.id === id + ? { + ...row, + visited: !row.visited, + status: !row.visited ? "Visited" : "Pending", + } + : row + ) + ); + }; + + const paginationModel = { page: 0, pageSize: 15 }; + + return ( +
+ + Reservations: + +
+ +
+
+ ); +} diff --git a/client/package-lock.json b/client/package-lock.json index c957b69..791caf5 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -11,10 +11,12 @@ "@emotion/cache": "^11.13.1", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + "@fontsource/roboto": "^5.1.0", "@mui/base": "^5.0.0-beta.61", "@mui/icons-material": "^6.1.7", "@mui/material": "^6.1.6", "@mui/material-nextjs": "^6.1.6", + "@mui/x-data-grid": "^7.22.2", "@mui/x-date-pickers": "^7.22.2", "dayjs": "^1.11.13", "joi": "^17.13.3", @@ -373,6 +375,11 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fontsource/roboto": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.1.0.tgz", + "integrity": "sha512-cFRRC1s6RqPygeZ8Uw/acwVHqih8Czjt6Q0MwoUoDe9U3m4dH1HmNDRBZyqlMSFwgNAUKgFImncKdmDHyKpwdg==", + "license": "Apache-2.0" "node_modules/@floating-ui/core": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.8.tgz", @@ -1186,6 +1193,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, + "node_modules/@mui/x-data-grid": { + "version": "7.22.2", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-7.22.2.tgz", + "integrity": "sha512-yfy2s5A6tbajQZiEdsba49T4FYb9F0WPrzbbG30dl1+sIiX4ZRX7ma44UIDGPZrsZv8xkkE+p8qeJxZ7OaMteA==", + "license": "MIT", "node_modules/@mui/x-date-pickers": { "version": "7.22.2", "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-7.22.2.tgz", @@ -1194,6 +1206,7 @@ "@babel/runtime": "^7.25.7", "@mui/utils": "^5.16.6 || ^6.0.0", "@mui/x-internals": "7.21.0", + "reselect": "^5.1.1" "@types/react-transition-group": "^4.4.11", "clsx": "^2.1.1", "prop-types": "^15.8.1", @@ -1227,6 +1240,7 @@ }, "@emotion/styled": { "optional": true + }, "date-fns": { "optional": true @@ -1248,6 +1262,7 @@ }, "moment-jalaali": { "optional": true + } } }, @@ -1255,6 +1270,7 @@ "version": "7.21.0", "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-7.21.0.tgz", "integrity": "sha512-94YNyZ0BhK5Z+Tkr90RKf47IVCW8R/1MvdUhh6MCQg6sZa74jsX+x+gEZ4kzuCqOsuyTyxikeQ8vVuCIQiP7UQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", "@mui/utils": "^5.16.6 || ^6.0.0" @@ -5100,6 +5116,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/reselect": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", + "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", + "license": "MIT" + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", diff --git a/client/package.json b/client/package.json index 179fc68..5b95b71 100644 --- a/client/package.json +++ b/client/package.json @@ -14,8 +14,10 @@ "@emotion/styled": "^11.13.0", "@mui/base": "^5.0.0-beta.61", "@mui/icons-material": "^6.1.7", + "@fontsource/roboto": "^5.1.0", "@mui/material": "^6.1.6", "@mui/material-nextjs": "^6.1.6", + "@mui/x-data-grid": "^7.22.2", "@mui/x-date-pickers": "^7.22.2", "dayjs": "^1.11.13", "joi": "^17.13.3", diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..9414067 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "v52-tier3-team-39", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}