generated from chingu-voyages/voyage-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #87 from chingu-voyages/admin_dashboard
Admin dashboard
Showing
13 changed files
with
228 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
import Box from "@mui/material/Box"; | ||
import Grid from "./Grid"; | ||
import { fetchAppointments } from "@/actions/form"; | ||
|
||
export default function ReservationTable({ initAppointments }) { | ||
const [appointments, setAppointments] = useState(initAppointments); | ||
|
||
const refreshData = async () => { | ||
const updatedAppts = await fetchAppointments(); | ||
|
||
setAppointments(updatedAppts); | ||
}; | ||
|
||
console.log("reso table - grid", appointments); | ||
|
||
export default function ReservationTable({ appointments }) { | ||
return ( | ||
<Box sx={{ height: "100%", width: "100%" }}> | ||
<Grid rows={appointments} /> | ||
<Grid rows={appointments} refreshData={refreshData} /> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
client/components/admin_dashboard/grid-components/VisitedChip.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Button } from "@mui/material"; | ||
|
||
const VisitedChip = ({ id, status, toggleVisited }) => { | ||
const visited = status === "Visited" || status === "Completed"; | ||
|
||
return ( | ||
<Button | ||
variant={visited ? "contained" : "outlined"} | ||
color="primary" | ||
onClick={() => toggleVisited(id, visited ? "Scheduled" : "Completed")} | ||
> | ||
{visited ? "Visited" : "Not Visited"} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default VisitedChip; |
Oops, something went wrong.