diff --git a/frontend/peerprep/app/components/table/historytable.tsx b/frontend/peerprep/app/components/table/historytable.tsx new file mode 100644 index 000000000..338d8dbd0 --- /dev/null +++ b/frontend/peerprep/app/components/table/historytable.tsx @@ -0,0 +1,52 @@ +import { Button, Card, Divider, Table, Text, Pagination, Group } from "@mantine/core"; +import classes from "./table.module.css"; + +export type InterviewHistory = { + question: string; + completionDate: string; + difficulty: string; + topic: string; + language: string; +}; + +export default function HistoryTable({ data }: { data: InterviewHistory[] }) { + const rows = data.map((row) => ( + + {row.question} + {row.completionDate} + {row.difficulty} + {row.topic} + {row.language} + + + + + )); + return ( + + + Interviews + + + + + + + Question + Completion Date + Difficulty + Topic + Language + + + + {rows} +
+
+ + + + +
+ ); +} diff --git a/frontend/peerprep/app/components/table/questionstable.tsx b/frontend/peerprep/app/components/table/questionstable.tsx new file mode 100644 index 000000000..6e3696dfc --- /dev/null +++ b/frontend/peerprep/app/components/table/questionstable.tsx @@ -0,0 +1,60 @@ +import { Button, Card, Divider, Table, Text, Pagination, Group, Input } from "@mantine/core"; +import classes from "./table.module.css"; + +export type QuestionHistory = { + question: string; + dateAdded: string; + lastEdited: string; + difficulty: string; + topic: string; +}; + +export default function QuestionsTable({ data }: { data: QuestionHistory[] }) { + const rows = data.map((row) => ( + + {row.question} + {row.dateAdded} + {row.lastEdited} + {row.difficulty} + {row.topic} + + + + + + + + )); + return ( + + + + Questions + + + + + + + + + + Question + Date Added + Last Edited + Difficulty + Topic + + + + + {rows} +
+
+ + + + +
+ ); +} diff --git a/frontend/peerprep/app/pages/adminpage.tsx b/frontend/peerprep/app/pages/adminpage.tsx new file mode 100644 index 000000000..cb458eab3 --- /dev/null +++ b/frontend/peerprep/app/pages/adminpage.tsx @@ -0,0 +1,73 @@ +import { + Grid, + useMantineTheme, + Button +} from "@mantine/core"; + +import StatsCard from "../components/statscard"; +import QuestionsTable from "~/components/table/questionstable"; +import type {QuestionHistory} from "../components/table/questionstable"; + +import { useState } from "react"; + +export function meta() { + return [ + { title: "PeerPrep - Homepage" }, + { name: "description", content: "Welcome to PeerPrep!" }, + ]; +} + +export default function Userpage() { + const theme = useMantineTheme(); + + const [data, ] = useState([ + { + question: "Two Sum", + dateAdded: "2024-10-01", + lastEdited: "2024-10-01", + difficulty: "Easy", + topic: "Array", + }, + ]); + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + ); +}