From 8cfa8a79a05fa390b6410b0d9ad0729e47532fc3 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 25 Apr 2025 17:23:19 +0100 Subject: [PATCH 1/2] First Commit After a Long changes --- package-lock.json | 111 ++++++++++++++++++++ package.json | 11 +- src/app/(dashboard)/admin/page.tsx | 47 +++++++++ src/app/(dashboard)/layout.tsx | 32 ++++++ src/app/(dashboard)/parent/page.tsx | 7 ++ src/app/(dashboard)/student/page.tsx | 7 ++ src/app/(dashboard)/teacher/page.tsx | 7 ++ src/app/globals.css | 17 ++- src/app/sign-in/page.tsx | 7 ++ src/components/Announcements.tsx | 55 ++++++++++ src/components/AttendanceChart.tsx | 88 ++++++++++++++++ src/components/CountChart.tsx | 81 +++++++++++++++ src/components/EventCalendar.tsx | 77 ++++++++++++++ src/components/FinanceChart.tsx | 149 +++++++++++++++++++++++++++ src/components/Menu.tsx | 31 +++++- src/components/Navbar.tsx | 44 ++++++++ src/components/UserCard.tsx | 18 ++++ tailwind.config.ts | 8 ++ 18 files changed, 790 insertions(+), 7 deletions(-) create mode 100644 src/app/(dashboard)/admin/page.tsx create mode 100644 src/app/(dashboard)/layout.tsx create mode 100644 src/app/(dashboard)/parent/page.tsx create mode 100644 src/app/(dashboard)/student/page.tsx create mode 100644 src/app/(dashboard)/teacher/page.tsx create mode 100644 src/app/sign-in/page.tsx create mode 100644 src/components/Announcements.tsx create mode 100644 src/components/AttendanceChart.tsx create mode 100644 src/components/CountChart.tsx create mode 100644 src/components/EventCalendar.tsx create mode 100644 src/components/FinanceChart.tsx create mode 100644 src/components/Navbar.tsx create mode 100644 src/components/UserCard.tsx diff --git a/package-lock.json b/package-lock.json index cf999766d..5a6be1b2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "next": "14.2.5", "react": "^18", + "react-calendar": "^5.1.0", "react-dom": "^18" }, "devDependencies": { @@ -652,6 +653,15 @@ "dev": true, "license": "ISC" }, + "node_modules/@wojtekmaj/date-utils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@wojtekmaj/date-utils/-/date-utils-1.5.1.tgz", + "integrity": "sha512-+i7+JmNiE/3c9FKxzWFi2IjRJ+KzZl1QPu6QNrsgaa2MuBgXvUy4gA1TVzf/JMdIIloB76xSKikTWuyYAIVLww==", + "license": "MIT", + "funding": { + "url": "https://github.com/wojtekmaj/date-utils?sponsor=1" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -1150,6 +1160,15 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2346,6 +2365,18 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/get-user-locale": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/get-user-locale/-/get-user-locale-2.3.2.tgz", + "integrity": "sha512-O2GWvQkhnbDoWFUJfaBlDIKUEdND8ATpBXD6KXcbhxlfktyD/d8w6mkzM/IlQEqGZAMz/PW6j6Hv53BiigKLUQ==", + "license": "MIT", + "dependencies": { + "mem": "^8.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/get-user-locale?sponsor=1" + } + }, "node_modules/glob": { "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", @@ -3291,6 +3322,34 @@ "dev": true, "license": "ISC" }, + "node_modules/map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "license": "MIT", + "dependencies": { + "p-defer": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mem": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", + "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", + "license": "MIT", + "dependencies": { + "map-age-cleaner": "^0.1.3", + "mimic-fn": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/mem?sponsor=1" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3315,6 +3374,15 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3654,6 +3722,15 @@ "node": ">= 0.8.0" } }, + "node_modules/p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4040,6 +4117,31 @@ "node": ">=0.10.0" } }, + "node_modules/react-calendar": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-calendar/-/react-calendar-5.1.0.tgz", + "integrity": "sha512-09o/rQHPZGEi658IXAJtWfra1N69D1eFnuJ3FQm9qUVzlzNnos1+GWgGiUeSs22QOpNm32aoVFOimq0p3Ug9Eg==", + "license": "MIT", + "dependencies": { + "@wojtekmaj/date-utils": "^1.1.3", + "clsx": "^2.0.0", + "get-user-locale": "^2.2.1", + "warning": "^4.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/react-calendar?sponsor=1" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -5004,6 +5106,15 @@ "dev": true, "license": "MIT" }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index dd3389bbf..e8666d11c 100644 --- a/package.json +++ b/package.json @@ -9,18 +9,19 @@ "lint": "next lint" }, "dependencies": { + "next": "14.2.5", "react": "^18", - "react-dom": "^18", - "next": "14.2.5" + "react-calendar": "^5.1.0", + "react-dom": "^18" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "eslint": "^8", + "eslint-config-next": "14.2.5", "postcss": "^8", "tailwindcss": "^3.4.1", - "eslint": "^8", - "eslint-config-next": "14.2.5" + "typescript": "^5" } } diff --git a/src/app/(dashboard)/admin/page.tsx b/src/app/(dashboard)/admin/page.tsx new file mode 100644 index 000000000..6688a8e3a --- /dev/null +++ b/src/app/(dashboard)/admin/page.tsx @@ -0,0 +1,47 @@ +import FinanceChart from "@/components/FinanceChart"; +import AttendanceChart from "@/components/AttendanceChart"; +import CountChart from "@/components/CountChart"; +import UserCard from "@/components/UserCard"; +import EventCalendar from "@/components/EventCalendar"; +import Announcements from "@/components/Announcements"; + +export default function AdminPage() { + return ( +
+ {/* LEFT */} +
+ {/* USER CARDS */} +
+ + + + +
+ + {/* MIDDLE CHART */} +
+ {/* COUNT CHART */} +
+ +
+ + {/* ATTENTANCE CHART */} +
+ +
+
+ + {/* BOTTOM CHART */} +
+ +
+
+ + {/* RIGHT */} +
+ + +
+
+ ); +} diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx new file mode 100644 index 000000000..b63a7948a --- /dev/null +++ b/src/app/(dashboard)/layout.tsx @@ -0,0 +1,32 @@ +"use client"; +import Menu from "@/components/Menu"; +import Navbar from "@/components/Navbar"; +import Image from "next/image"; +import Link from "next/link"; + +export default function DashboardLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( +
+ {/* LEFT */} +
+ + logo + SchooLama + + +
+ {/* RIGHT */} +
+ + {children} +
+
+ ); +} diff --git a/src/app/(dashboard)/parent/page.tsx b/src/app/(dashboard)/parent/page.tsx new file mode 100644 index 000000000..45e135430 --- /dev/null +++ b/src/app/(dashboard)/parent/page.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +function ParentPage() { + return
ParentPage
; +} + +export default ParentPage; diff --git a/src/app/(dashboard)/student/page.tsx b/src/app/(dashboard)/student/page.tsx new file mode 100644 index 000000000..1e887c494 --- /dev/null +++ b/src/app/(dashboard)/student/page.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +function StudentPage() { + return
StudentPage
; +} + +export default StudentPage; diff --git a/src/app/(dashboard)/teacher/page.tsx b/src/app/(dashboard)/teacher/page.tsx new file mode 100644 index 000000000..8f2724cc9 --- /dev/null +++ b/src/app/(dashboard)/teacher/page.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +function TeacherPage() { + return
TeacherPage
; +} + +export default TeacherPage; diff --git a/src/app/globals.css b/src/app/globals.css index bd6213e1d..8e3d4e405 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,3 +1,18 @@ @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; + +.react-calendar { + width: 100% !important; + border: none !important; + font-family: inter !important; +} + +.react-calendar__navigation__label__labelText { + font-weight: 600; +} + +.react-calendar__tile--active { + background-color: #c3ebfa !important; + color: black !important; +} diff --git a/src/app/sign-in/page.tsx b/src/app/sign-in/page.tsx new file mode 100644 index 000000000..15f723760 --- /dev/null +++ b/src/app/sign-in/page.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +function LoginPage() { + return
LoginPage
; +} + +export default LoginPage; diff --git a/src/components/Announcements.tsx b/src/components/Announcements.tsx new file mode 100644 index 000000000..3b24e7ff7 --- /dev/null +++ b/src/components/Announcements.tsx @@ -0,0 +1,55 @@ +function Announcements() { + return ( +
+
+

Annoucements

+ Veiw All +
+
+
+
+

Lorem ipsum dolor sit

+ + 2025-03-18 + +
+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores + tempora obcaecati possimus consectetur voluptas nesciunt natus + beatae +

+
+ +
+
+

Lorem ipsum dolor sit

+ + 2025-03-18 + +
+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores + tempora obcaecati possimus consectetur voluptas nesciunt natus + beatae +

+
+ +
+
+

Lorem ipsum dolor sit

+ + 2025-03-18 + +
+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores + tempora obcaecati possimus consectetur voluptas nesciunt natus + beatae +

+
+
+
+ ); +} + +export default Announcements; diff --git a/src/components/AttendanceChart.tsx b/src/components/AttendanceChart.tsx new file mode 100644 index 000000000..75b47e1f5 --- /dev/null +++ b/src/components/AttendanceChart.tsx @@ -0,0 +1,88 @@ +"use client"; + +import Image from "next/image"; +import { + BarChart, + Bar, + Rectangle, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + Legend, + ResponsiveContainer, +} from "recharts"; + +const data = [ + { + name: "Mon", + present: 40, + absent: 24, + }, + { + name: "Tue", + present: 30, + absent: 13, + }, + { + name: "Wed", + present: 20, + absent: 98, + }, + { + name: "Thu", + present: 27, + absent: 39, + }, + { + name: "Fri", + present: 18, + absent: 48, + }, +]; + +function AttendanceChart() { + return ( +
+
+

Attendance

+ +
+ + + + + + + + + + + + +
+ ); +} + +export default AttendanceChart; diff --git a/src/components/CountChart.tsx b/src/components/CountChart.tsx new file mode 100644 index 000000000..631930aa1 --- /dev/null +++ b/src/components/CountChart.tsx @@ -0,0 +1,81 @@ +"use client"; + +import { count } from "console"; +import Image from "next/image"; + +import { + RadialBarChart, + RadialBar, + Legend, + ResponsiveContainer, +} from "recharts"; + +const data = [ + { + name: "Total", + count: 106, + fill: "white", + }, + { + name: "Girls", + count: 53, + fill: "#FAE27C", + }, + { + name: "Boys", + count: 53, + fill: "#C3EBFA", + }, +]; + +function CountChart() { + return ( +
+ {/* TITLE */} +
+

Students

+ +
+ + {/* CHART */} +
+ + + + + + +
+ + {/* BOTTOM */} +
+
+
+

1,234

+

Boys (55%)

+
+ +
+
+

1,234

+

Girls (45%)

+
+
+
+ ); +} + +export default CountChart; diff --git a/src/components/EventCalendar.tsx b/src/components/EventCalendar.tsx new file mode 100644 index 000000000..0875ff055 --- /dev/null +++ b/src/components/EventCalendar.tsx @@ -0,0 +1,77 @@ +"use client"; + +import "react-calendar/dist/Calendar.css"; +import { useState } from "react"; +import Calendar from "react-calendar"; +import Image from "next/image"; + +type ValuePiece = Date | null; + +type Value = ValuePiece | [ValuePiece, ValuePiece]; + +// TEMPOARY +const events = [ + { + id: 1, + title: "Lorem ipsum, dolor", + time: "12:00 PM - 2:00 PM", + description: "Lorem ipsum dolor sit amet consectetur adipisicing elit.", + }, + + { + id: 2, + title: "Lorem ipsum, dolor", + time: "12:00 PM - 2:00 PM", + description: "Lorem ipsum dolor sit amet consectetur adipisicing elit.", + }, + + { + id: 3, + title: "Lorem ipsum, dolor", + time: "12:00 PM - 2:00 PM", + description: "Lorem ipsum dolor sit amet consectetur adipisicing elit.", + }, + + { + id: 4, + title: "Lorem ipsum, dolor", + time: "12:00 PM - 2:00 PM", + description: "Lorem ipsum dolor sit amet consectetur adipisicing elit.", + }, + + { + id: 5, + title: "Lorem ipsum, dolor", + time: "12:00 PM - 2:00 PM", + description: "Lorem ipsum dolor sit amet consectetur adipisicing elit.", + }, +]; + +function EventCalendar() { + const [value, onChange] = useState(new Date()); + return ( +
+ +
+

Events

+ +
+
+ {events.map((event) => ( +
+
+

{event.title}

+ {event.time} +
+

{event.description}

+
+ ))} +
+
+ ); +} + +export default EventCalendar; diff --git a/src/components/FinanceChart.tsx b/src/components/FinanceChart.tsx new file mode 100644 index 000000000..18c0ab5a0 --- /dev/null +++ b/src/components/FinanceChart.tsx @@ -0,0 +1,149 @@ +"use client"; + +import { + LineChart, + Line, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + Legend, + ResponsiveContainer, +} from "recharts"; + +const data = [ + { + name: "Jan", + Income: 4000, + Expense: 2400, + amt: 2400, + }, + { + name: "Feb", + Income: 3000, + Expense: 1398, + amt: 2210, + }, + { + name: "Mar", + Income: 2000, + Expense: 9800, + amt: 2290, + }, + { + name: "Apr", + Income: 2780, + Expense: 3908, + amt: 2000, + }, + { + name: "May", + Income: 1890, + Expense: 4800, + amt: 2181, + }, + { + name: "Jun", + Income: 2390, + Expense: 3800, + amt: 2500, + }, + { + name: "Jul", + Income: 3490, + Expense: 4300, + amt: 2100, + }, + { + name: "Aug", + Income: 2000, + Expense: 9800, + amt: 2290, + }, + { + name: "Sept", + Income: 2780, + Expense: 3908, + amt: 2000, + }, + { + name: "Oct", + Income: 1890, + Expense: 4800, + amt: 2181, + }, + { + name: "Nov", + Income: 2390, + Expense: 3800, + amt: 2500, + }, + { + name: "Dec", + Income: 3490, + Expense: 4300, + amt: 2100, + }, +]; + +import Image from "next/image"; + +function FinanceChart() { + return ( +
+
+

Finance

+ +
+ + + + + + + + + + + + +
+ ); +} + +export default FinanceChart; diff --git a/src/components/Menu.tsx b/src/components/Menu.tsx index de074fa04..176c534d7 100644 --- a/src/components/Menu.tsx +++ b/src/components/Menu.tsx @@ -1,3 +1,6 @@ +import Link from "next/link"; +import Image from "next/image"; + const menuItems = [ { title: "MENU", @@ -111,4 +114,30 @@ const menuItems = [ }, ], }, -]; \ No newline at end of file +]; + +function Menu() { + return ( +
+ {menuItems.map((obj) => ( +
+ + {obj.title} + + {obj.items.map((value) => ( + + + {value.label} + + ))} +
+ ))} +
+ ); +} + +export default Menu; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx new file mode 100644 index 000000000..46eaa7e10 --- /dev/null +++ b/src/components/Navbar.tsx @@ -0,0 +1,44 @@ +import Image from "next/image"; + +function Navbar() { + return ( + + ); +} + +export default Navbar; diff --git a/src/components/UserCard.tsx b/src/components/UserCard.tsx new file mode 100644 index 000000000..5843ab5c8 --- /dev/null +++ b/src/components/UserCard.tsx @@ -0,0 +1,18 @@ +import Image from "next/image"; + +function UserCard({ type }: { type: string }) { + return ( +
+
+ + 2024/25 + + +
+

1,234

+

{type}s

+
+ ); +} + +export default UserCard; diff --git a/tailwind.config.ts b/tailwind.config.ts index e9a0944e7..05ca00768 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -13,6 +13,14 @@ const config: Config = { "gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", }, + colors: { + lamaSky: "#C3EBFA", + lamaSkyLight: "#EDF9FD", + lamaPurple: "#CFCEFF", + lamaPurpleLight: "#F1F0FF", + lamaYellow: "#FAE27C", + lamaYellowLight: "#FEFCE8", + }, }, }, plugins: [], From f474af663bc53859a0b575f4e9bdb70c8bc45027 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 25 Apr 2025 17:37:37 +0100 Subject: [PATCH 2/2] Second Commit --- next.config.mjs | 6 +- package-lock.json | 557 +++++++++++++++++- package.json | 6 +- src/app/(dashboard)/layout.tsx | 4 +- .../(dashboard)/list/announcements/page.tsx | 96 +++ src/app/(dashboard)/list/assignments/page.tsx | 103 ++++ src/app/(dashboard)/list/classes/page.tsx | 98 +++ src/app/(dashboard)/list/events/page.tsx | 108 ++++ src/app/(dashboard)/list/exams/page.tsx | 101 ++++ src/app/(dashboard)/list/lessons/page.tsx | 94 +++ src/app/(dashboard)/list/parents/page.tsx | 106 ++++ src/app/(dashboard)/list/results/page.tsx | 115 ++++ src/app/(dashboard)/list/students/page.tsx | 123 ++++ src/app/(dashboard)/list/subjects/page.tsx | 86 +++ .../(dashboard)/list/teachers/[id]/page.tsx | 144 +++++ src/app/(dashboard)/list/teachers/page.tsx | 128 ++++ src/app/(dashboard)/parent/page.tsx | 20 +- src/app/(dashboard)/student/page.tsx | 21 +- src/app/(dashboard)/teacher/page.tsx | 20 +- src/app/globals.css | 99 +++- src/components/Announcements.tsx | 3 +- src/components/BigCalendar.tsx | 34 ++ src/components/Menu.tsx | 28 +- src/components/Pagination.tsx | 28 + src/components/Performance.tsx | 43 ++ src/components/Table.tsx | 26 + src/components/TableSearch.tsx | 16 + src/lib/data.ts | 95 ++- 28 files changed, 2236 insertions(+), 72 deletions(-) create mode 100644 src/app/(dashboard)/list/announcements/page.tsx create mode 100644 src/app/(dashboard)/list/assignments/page.tsx create mode 100644 src/app/(dashboard)/list/classes/page.tsx create mode 100644 src/app/(dashboard)/list/events/page.tsx create mode 100644 src/app/(dashboard)/list/exams/page.tsx create mode 100644 src/app/(dashboard)/list/lessons/page.tsx create mode 100644 src/app/(dashboard)/list/parents/page.tsx create mode 100644 src/app/(dashboard)/list/results/page.tsx create mode 100644 src/app/(dashboard)/list/students/page.tsx create mode 100644 src/app/(dashboard)/list/subjects/page.tsx create mode 100644 src/app/(dashboard)/list/teachers/[id]/page.tsx create mode 100644 src/app/(dashboard)/list/teachers/page.tsx create mode 100644 src/components/BigCalendar.tsx create mode 100644 src/components/Pagination.tsx create mode 100644 src/components/Performance.tsx create mode 100644 src/components/Table.tsx create mode 100644 src/components/TableSearch.tsx diff --git a/next.config.mjs b/next.config.mjs index 4678774e6..f6c572929 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,8 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + images: { + remotePatterns: [{ hostname: "images.pexels.com" }], + }, +}; export default nextConfig; diff --git a/package-lock.json b/package-lock.json index 5a6be1b2c..23105c159 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,14 @@ "name": "lama-dev-next-dashboard", "version": "0.1.0", "dependencies": { + "@types/react-big-calendar": "^1.16.1", + "moment": "^2.30.1", "next": "14.2.5", "react": "^18", + "react-big-calendar": "^1.18.0", "react-calendar": "^5.1.0", - "react-dom": "^18" + "react-dom": "^18", + "recharts": "^2.15.2" }, "devDependencies": { "@types/node": "^20", @@ -37,6 +41,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@babel/runtime": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz", + "integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -444,6 +460,28 @@ "node": ">=14" } }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@restart/hooks": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.16.tgz", + "integrity": "sha512-f7aCv7c+nU/3mF7NWLtVVr0Ra80RqsO89hO72r+Y/nvQr5+q0UFGkocElTH6MJApvReVh6JHUFYn2cw1WdHF3w==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/@rushstack/eslint-patch": { "version": "1.10.4", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.4.tgz", @@ -467,6 +505,75 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/d3-array": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.1.tgz", + "integrity": "sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.7.tgz", + "integrity": "sha512-VLvUQ33C+3J+8p+Daf+nYSOsjB4GXp19/S/aGo60m9h1v6XaxjiT82lKVWJCfzhtuZ3yD7i/TPeC/fuKLLOSmg==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/date-arithmetic": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/date-arithmetic/-/date-arithmetic-4.1.4.tgz", + "integrity": "sha512-p9eZ2X9B80iKiTW4ukVj8B4K6q9/+xFtQ5MGYA5HWToY9nL4EkhV9+6ftT2VHpVMEZb5Tv00Iel516bVdO+yRw==", + "license": "MIT" + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -488,20 +595,29 @@ "version": "15.7.12", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==", - "dev": true, "license": "MIT" }, "node_modules/@types/react": { "version": "18.3.3", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", - "dev": true, "license": "MIT", "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" } }, + "node_modules/@types/react-big-calendar": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/@types/react-big-calendar/-/react-big-calendar-1.16.1.tgz", + "integrity": "sha512-pDHFcVWx+BvZbX6U39R4l8c9930vKnfx+09lf4W8r8HuxBDLzGk7Q63ncBmqqnQImEFNDKfwa6MDyu90cfzJ2A==", + "license": "MIT", + "dependencies": { + "@types/date-arithmetic": "*", + "@types/prop-types": "*", + "@types/react": "*" + } + }, "node_modules/@types/react-dom": { "version": "18.3.0", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", @@ -512,6 +628,12 @@ "@types/react": "*" } }, + "node_modules/@types/warning": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.3.tgz", + "integrity": "sha512-D1XC7WK8K+zZEveUPY+cf4+kgauk8N4eHr/XIHXGlGYkHLud6hK9lYfZk1ry1TNh798cZUCgb6MqGEG8DkJt6Q==", + "license": "MIT" + }, "node_modules/@typescript-eslint/parser": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", @@ -1238,9 +1360,129 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, "license": "MIT" }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/damerau-levenshtein": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", @@ -1302,6 +1544,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/date-arithmetic": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-arithmetic/-/date-arithmetic-4.1.0.tgz", + "integrity": "sha512-QWxYLR5P/6GStZcdem+V1xoto6DMadYWpMXU82ES3/RfR3Wdwr3D0+be7mgOJ+Ov0G9D5Dmb9T17sNLQYj9XOg==", + "license": "MIT" + }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", @@ -1320,6 +1574,12 @@ } } }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, "node_modules/deep-equal": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", @@ -1396,6 +1656,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -1436,6 +1705,16 @@ "node": ">=6.0.0" } }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2100,6 +2379,12 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2107,6 +2392,15 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-equals": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", + "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -2439,6 +2733,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/globalize": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/globalize/-/globalize-0.1.1.tgz", + "integrity": "sha512-5e01v8eLGfuQSOvx2MsDMOWS0GFtCx1wPzQSmcHw4hkxFzrQDBO3Xwg/m8Hr/7qXMrHeOIE29qWVzyv06u1TZA==" + }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -2678,6 +2977,24 @@ "node": ">= 0.4" } }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -3296,6 +3613,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -3322,6 +3651,15 @@ "dev": true, "license": "ISC" }, + "node_modules/luxon": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -3350,6 +3688,12 @@ "url": "https://github.com/sindresorhus/mem?sponsor=1" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "license": "MIT" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3416,6 +3760,27 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.47", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", + "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", + "license": "MIT", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3552,7 +3917,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4066,7 +4430,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", @@ -4117,6 +4480,43 @@ "node": ">=0.10.0" } }, + "node_modules/react-big-calendar": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/react-big-calendar/-/react-big-calendar-1.18.0.tgz", + "integrity": "sha512-bGrCdyfnCGe2qnIdEoGkGgQdEFOiGO1Tq7RLkI1a2t8ZudyEAKekFtneO2/ltKQEQK6zH76YdJ7vR9UMyD+ULw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.7", + "clsx": "^1.2.1", + "date-arithmetic": "^4.1.0", + "dayjs": "^1.11.7", + "dom-helpers": "^5.2.1", + "globalize": "^0.1.1", + "invariant": "^2.2.4", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "luxon": "^3.2.1", + "memoize-one": "^6.0.0", + "moment": "^2.29.4", + "moment-timezone": "^0.5.40", + "prop-types": "^15.8.1", + "react-overlays": "^5.2.1", + "uncontrollable": "^7.2.1" + }, + "peerDependencies": { + "react": "^16.14.0 || ^17 || ^18 || ^19", + "react-dom": "^16.14.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/react-big-calendar/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/react-calendar": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/react-calendar/-/react-calendar-5.1.0.tgz", @@ -4159,9 +4559,65 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, "license": "MIT" }, + "node_modules/react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", + "license": "MIT" + }, + "node_modules/react-overlays": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.11.6", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -4185,6 +4641,44 @@ "node": ">=8.10.0" } }, + "node_modules/recharts": { + "version": "2.15.2", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.2.tgz", + "integrity": "sha512-xv9lVztv3ingk7V3Jf05wfAZbM9Q2umJzu5t/cfnAK7LUslNrGT7LPBr74G+ok8kSCeFMaePmWMg0rcYOnczTw==", + "license": "MIT", + "dependencies": { + "clsx": "^2.0.0", + "eventemitter3": "^4.0.1", + "lodash": "^4.17.21", + "react-is": "^18.3.1", + "react-smooth": "^4.0.4", + "recharts-scale": "^0.4.4", + "tiny-invariant": "^1.3.1", + "victory-vendor": "^36.6.8" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts-scale": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", + "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", + "license": "MIT", + "dependencies": { + "decimal.js-light": "^2.4.1" + } + }, + "node_modules/recharts/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", @@ -4207,6 +4701,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -4897,6 +5397,12 @@ "node": ">=0.8" } }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5082,6 +5588,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + }, + "peerDependencies": { + "react": ">=15.0.0" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -5106,6 +5627,28 @@ "dev": true, "license": "MIT" }, + "node_modules/victory-vendor": { + "version": "36.9.2", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", + "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, "node_modules/warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", diff --git a/package.json b/package.json index e8666d11c..0efd3f0f8 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,14 @@ "lint": "next lint" }, "dependencies": { + "@types/react-big-calendar": "^1.16.1", + "moment": "^2.30.1", "next": "14.2.5", "react": "^18", + "react-big-calendar": "^1.18.0", "react-calendar": "^5.1.0", - "react-dom": "^18" + "react-dom": "^18", + "recharts": "^2.15.2" }, "devDependencies": { "@types/node": "^20", diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx index b63a7948a..330d40e22 100644 --- a/src/app/(dashboard)/layout.tsx +++ b/src/app/(dashboard)/layout.tsx @@ -15,7 +15,7 @@ export default function DashboardLayout({
logo SchooLama @@ -23,7 +23,7 @@ export default function DashboardLayout({
{/* RIGHT */} -
+
{children}
diff --git a/src/app/(dashboard)/list/announcements/page.tsx b/src/app/(dashboard)/list/announcements/page.tsx new file mode 100644 index 000000000..2f9cbc778 --- /dev/null +++ b/src/app/(dashboard)/list/announcements/page.tsx @@ -0,0 +1,96 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { announcementsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Announcement = { + id: number; + title: string; + class: string; + date: string; +}; + +const columns = [ + { + header: "Title", + accessor: "title", + }, + { + header: "Class", + accessor: "class", + }, + { + header: "Date", + accessor: "date", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function AnnouncementListpage() { + const renderRow = (item: Announcement) => ( + + + {item.title} + + {item.class} + {item.date} + + + + + + {role === "admin" && ( + + )} + + + ); + + return ( +
+ {/* TOP */} +
+

+ All Announcements +

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} + + {/* PAGINATION */} + + + ); +} + +export default AnnouncementListpage; diff --git a/src/app/(dashboard)/list/assignments/page.tsx b/src/app/(dashboard)/list/assignments/page.tsx new file mode 100644 index 000000000..8c371ad82 --- /dev/null +++ b/src/app/(dashboard)/list/assignments/page.tsx @@ -0,0 +1,103 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { assignmentsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Assigment = { + id: number; + subject: string; + class: string; + teacher: string; + dueDate: string; +}; + +const columns = [ + { + header: "Subject", + accessor: "subject", + }, + { + header: "Class", + accessor: "class", + }, + { + header: "Teacher", + accessor: "teacher", + className: "hidden md:table-cell", + }, + { + header: "Due Date", + accessor: "dueDate", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function AssignmentListpage() { + const renderRow = (item: Assigment) => ( + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

+ All Assignments +

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ {item.subject} + {item.class}{item.teacher}{item.dueDate} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default AssignmentListpage; diff --git a/src/app/(dashboard)/list/classes/page.tsx b/src/app/(dashboard)/list/classes/page.tsx new file mode 100644 index 000000000..0c32b3e43 --- /dev/null +++ b/src/app/(dashboard)/list/classes/page.tsx @@ -0,0 +1,98 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { classesData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Classes = { + id: number; + name: string; + capacity: number; + grade: number; + supervisor: string; +}; + +const columns = [ + { + header: "Class Name", + accessor: "name", + }, + { + header: "Capacity", + accessor: "capacity", + }, + { + header: "Grade", + accessor: "grade", + }, + { + header: "Supervisor", + accessor: "supervisor", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function ClassListpage() { + const renderRow = (item: Classes) => ( + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Classes

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
{item.name}{item.capacity}{item.grade}{item.supervisor} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default ClassListpage; diff --git a/src/app/(dashboard)/list/events/page.tsx b/src/app/(dashboard)/list/events/page.tsx new file mode 100644 index 000000000..7faee6b7e --- /dev/null +++ b/src/app/(dashboard)/list/events/page.tsx @@ -0,0 +1,108 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { eventsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Event = { + id: number; + title: string; + class: string; + date: string; + startTime: string; + endTime: string; +}; + +const columns = [ + { + header: "Title", + accessor: "title", + }, + { + header: "Class", + accessor: "class", + }, + { + header: "Date", + accessor: "date", + className: "hidden md:table-cell", + }, + { + header: "Start Time", + accessor: "startTime", + className: "hidden md:table-cell", + }, + { + header: "End Time", + accessor: "endTime", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function EventListpage() { + const renderRow = (item: Event) => ( + + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Events

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ {item.title} + {item.class}{item.date}{item.startTime}{item.endTime} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default EventListpage; diff --git a/src/app/(dashboard)/list/exams/page.tsx b/src/app/(dashboard)/list/exams/page.tsx new file mode 100644 index 000000000..fc6b1f196 --- /dev/null +++ b/src/app/(dashboard)/list/exams/page.tsx @@ -0,0 +1,101 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { examsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Exam = { + id: number; + subject: string; + class: string; + teacher: string; + date: string; +}; + +const columns = [ + { + header: "Subject", + accessor: "subject", + }, + { + header: "Class", + accessor: "class", + }, + { + header: "Teacher", + accessor: "teacher", + className: "hidden md:table-cell", + }, + { + header: "Date", + accessor: "date", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function ExamListpage() { + const renderRow = (item: Exam) => ( + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Exams

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ {item.subject} + {item.class}{item.teacher}{item.date} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default ExamListpage; diff --git a/src/app/(dashboard)/list/lessons/page.tsx b/src/app/(dashboard)/list/lessons/page.tsx new file mode 100644 index 000000000..4417fb24c --- /dev/null +++ b/src/app/(dashboard)/list/lessons/page.tsx @@ -0,0 +1,94 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { lessonsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Lesson = { + id: number; + subject: string; + class: string; + teacher: string; +}; + +const columns = [ + { + header: "Subject Name", + accessor: "subject", + }, + { + header: "Class", + accessor: "class", + }, + { + header: "Teacher", + accessor: "teacher", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function LessonListpage() { + const renderRow = (item: Lesson) => ( + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Lessons

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ {item.subject} + {item.class}{item.teacher} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default LessonListpage; diff --git a/src/app/(dashboard)/list/parents/page.tsx b/src/app/(dashboard)/list/parents/page.tsx new file mode 100644 index 000000000..ea12bfb85 --- /dev/null +++ b/src/app/(dashboard)/list/parents/page.tsx @@ -0,0 +1,106 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { parentsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Parent = { + id: number; + name: string; + students: string[]; + email?: string; + phone: string; + address: string; +}; + +const columns = [ + { + header: "Info", + accessor: "info", + }, + { + header: "Student Names", + accessor: "students", + className: "hidden md:table-cell", + }, + { + header: "Phone", + accessor: "phone", + className: "hidden lg:table-cell", + }, + { + header: "Address", + accessor: "address", + className: "hidden lg:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function ParentListpage() { + const renderRow = (item: Parent) => ( + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Parents

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+
+

{item.name}

+

{item?.email}

+
+
{item.students.join(", ")}{item.phone}{item.address} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default ParentListpage; diff --git a/src/app/(dashboard)/list/results/page.tsx b/src/app/(dashboard)/list/results/page.tsx new file mode 100644 index 000000000..fc3f55307 --- /dev/null +++ b/src/app/(dashboard)/list/results/page.tsx @@ -0,0 +1,115 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { resultsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Result = { + id: number; + subject: string; + class: string; + teacher: string; + student: string; + date: string; + type: "exam" | "assignment"; + score: number; +}; + +const columns = [ + { + header: "Subject", + accessor: "subject", + }, + { + header: "Student", + accessor: "student", + }, + { + header: "Score", + accessor: "score", + }, + { + header: "Teacher", + accessor: "teacher", + className: "hidden md:table-cell", + }, + { + header: "Class", + accessor: "class", + className: "hidden md:table-cell", + }, + { + header: "Date", + accessor: "date", + className: "hidden md:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function ResultListpage() { + const renderRow = (item: Result) => ( + + + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Results

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ {item.subject} + {item.student}{item.score}{item.teacher}{item.class}{item.date} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default ResultListpage; diff --git a/src/app/(dashboard)/list/students/page.tsx b/src/app/(dashboard)/list/students/page.tsx new file mode 100644 index 000000000..412245ceb --- /dev/null +++ b/src/app/(dashboard)/list/students/page.tsx @@ -0,0 +1,123 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { studentsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Student = { + id: number; + studentId: string; + name: string; + email?: string; + photo: string; + phone?: string; + grade: number; + class: string; + address: string; +}; + +const columns = [ + { + header: "Info", + accessor: "info", + }, + { + header: "Student ID", + accessor: "studentId", + className: "hidden md:table-cell", + }, + { + header: "Grade", + accessor: "grade", + className: "hidden md:table-cell", + }, + { + header: "Phone", + accessor: "phone", + className: "hidden lg:table-cell", + }, + { + header: "Address", + accessor: "address", + className: "hidden lg:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function StudentListpage() { + const renderRow = (item: Student) => ( + + + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Students

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ +
+

{item.name}

+

{item.class}

+
+
{item.studentId}{item.grade}{item?.phone}{item.class}{item.address} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default StudentListpage; diff --git a/src/app/(dashboard)/list/subjects/page.tsx b/src/app/(dashboard)/list/subjects/page.tsx new file mode 100644 index 000000000..41b654b60 --- /dev/null +++ b/src/app/(dashboard)/list/subjects/page.tsx @@ -0,0 +1,86 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { subjectsData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Subject = { + id: number; + name: string; + teachers: string[]; +}; + +const columns = [ + { + header: "Subject Name", + accessor: "name", + }, + { + header: "Teachers", + accessor: "teachers", + className: "hidden lg:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function SubjectListpage() { + const renderRow = (item: Subject) => ( + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Subjects

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
{item.name}{item.teachers.join(", ")} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default SubjectListpage; diff --git a/src/app/(dashboard)/list/teachers/[id]/page.tsx b/src/app/(dashboard)/list/teachers/[id]/page.tsx new file mode 100644 index 000000000..98b800b3c --- /dev/null +++ b/src/app/(dashboard)/list/teachers/[id]/page.tsx @@ -0,0 +1,144 @@ +import Announcements from "@/components/Announcements"; +import BigCalendar from "@/components/BigCalendar"; +import Performance from "@/components/Performance"; +import Image from "next/image"; +import Link from "next/link"; + +function SingleTeacherpage() { + return ( +
+ {/* LEFT */} +
+ {/* TOP */} +
+ {/* USER INFO CARD */} +
+
+ +
+
+

Leonard Snyder

+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. +

+
+
+ + A+ +
+
+ + January 2025 +
+
+ + user@gmail.com +
+
+ + +1 234 567 786 +
+
+
+
+ + {/* SMALL CARDS */} +
+ {/* CARD */} +
+ +
+

90%

+ Attendance +
+
+
+ +
+

2

+ Branches +
+
+
+ +
+

6

+ Lesson +
+
+
+ +
+

6

+ Clasess +
+
+
+
+ + {/* BOTTOM */} +
+

Teacher's Schedule

+ +
+
+ {/* RIGHT */} +
+
+

Shortcuts

+
+ + Teacher's Classes + + + Teacher's Students + + + Teacher's Lessons + + + Teacher's Exams + + + Teacher's Assignments + +
+
+ + +
+
+ ); +} + +export default SingleTeacherpage; diff --git a/src/app/(dashboard)/list/teachers/page.tsx b/src/app/(dashboard)/list/teachers/page.tsx new file mode 100644 index 000000000..c31e43b27 --- /dev/null +++ b/src/app/(dashboard)/list/teachers/page.tsx @@ -0,0 +1,128 @@ +import Pagination from "@/components/Pagination"; +import Table from "@/components/Table"; +import TableSearch from "@/components/TableSearch"; +import { teachersData, role } from "@/lib/data"; +import Image from "next/image"; +import Link from "next/link"; + +type Teacher = { + id: number; + teacherId: string; + name: string; + email?: string; + photo: string; + phone: string; + subjects: string[]; + classes: string[]; + address: string; +}; + +const columns = [ + { + header: "Info", + accessor: "info", + }, + { + header: "Teacher ID", + accessor: "teacherId", + className: "hidden md:table-cell", + }, + { + header: "Subjects", + accessor: "subjects", + className: "hidden md:table-cell", + }, + { + header: "Classes", + accessor: "classes", + className: "hidden md:table-cell", + }, + { + header: "Phone", + accessor: "phone", + className: "hidden lg:table-cell", + }, + { + header: "Address", + accessor: "address", + className: "hidden lg:table-cell", + }, + { + header: "Action", + accessor: "action", + }, +]; + +function TeacherListpage() { + const renderRow = (item: Teacher) => ( +
+ + + + + + + + + ); + + return ( +
+ {/* TOP */} +
+

All Teachers

+
+ +
+ + + + + {role === "admin" && ( + + )} +
+
+
+ {/* LIST */} +
+ +
+

{item.name}

+

{item?.email}

+
+
{item.teacherId}{item.subjects.join(",")}{item.classes.join(",")}{item.phone}{item.address} + + + + + {role === "admin" && ( + + )} +
+ {/* PAGINATION */} + + + ); +} + +export default TeacherListpage; diff --git a/src/app/(dashboard)/parent/page.tsx b/src/app/(dashboard)/parent/page.tsx index 45e135430..46759fbcb 100644 --- a/src/app/(dashboard)/parent/page.tsx +++ b/src/app/(dashboard)/parent/page.tsx @@ -1,7 +1,23 @@ -import React from "react"; +import Announcements from "@/components/Announcements"; +import BigCalendar from "@/components/BigCalendar"; function ParentPage() { - return
ParentPage
; + return ( +
+ {/* LEFT */} +
+
+

Schedule (John Doe)

+ +
+
+ + {/* RIGHT */} +
+ +
+
+ ); } export default ParentPage; diff --git a/src/app/(dashboard)/student/page.tsx b/src/app/(dashboard)/student/page.tsx index 1e887c494..be6d38035 100644 --- a/src/app/(dashboard)/student/page.tsx +++ b/src/app/(dashboard)/student/page.tsx @@ -1,7 +1,26 @@ +import Announcements from "@/components/Announcements"; +import BigCalendar from "@/components/BigCalendar"; +import EventCalendar from "@/components/EventCalendar"; import React from "react"; function StudentPage() { - return
StudentPage
; + return ( +
+ {/* LEFT */} +
+
+

Schedule (4A)

+ +
+
+ + {/* RIGHT */} +
+ + +
+
+ ); } export default StudentPage; diff --git a/src/app/(dashboard)/teacher/page.tsx b/src/app/(dashboard)/teacher/page.tsx index 8f2724cc9..8c128ac83 100644 --- a/src/app/(dashboard)/teacher/page.tsx +++ b/src/app/(dashboard)/teacher/page.tsx @@ -1,7 +1,23 @@ -import React from "react"; +import Announcements from "@/components/Announcements"; +import BigCalendar from "@/components/BigCalendar"; function TeacherPage() { - return
TeacherPage
; + return ( +
+ {/* LEFT */} +
+
+

Schedule

+ +
+
+ + {/* RIGHT */} +
+ +
+
+ ); } export default TeacherPage; diff --git a/src/app/globals.css b/src/app/globals.css index 8e3d4e405..88635af94 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -9,10 +9,107 @@ } .react-calendar__navigation__label__labelText { - font-weight: 600; + font-weight: 600 !important; } .react-calendar__tile--active { background-color: #c3ebfa !important; color: black !important; } + +.rbc-btn-group:first-child { + display: none !important; +} + +.rbc-toolbar-label { + text-align: right !important; + padding: 0px 20px !important; +} + +.rbc-btn-group:last-child { + font-size: 13px !important; +} + +.rbc-btn-group:last-child button { + border: none !important; + background-color: #f1f0ff !important; + margin-left: 2px !important; +} + +.rbc-toolbar button.rbc-active { + background-color: #dbdafe !important; + box-shadow: none !important; +} + +.rbc-time-view { + border-color: #eee !important; +} + +.rbc-time-header { + display: none !important; +} + +.rbc-time-content { + border: none !important; +} + +.rbc-time-gutter.rbc-time-column { + font-size: 12px !important; +} + +.rbc-time-gutter.rbc-time-column .rbc-timeslot-group { + padding: 0px 20px !important; +} + +.rbc-timeslot-group { + background-color: #f7fdff !important; +} + +.rbc-day-slot { + font-size: 14px !important; +} + +.rbc-event { + border: none !important; + color: black !important; + padding: 10px !important; + margin: 10px !important; + width: 98% !important; +} + +.rbc-event:nth-child(1) { + background-color: #e2f8ff !important; +} + +.rbc-event:nth-child(2) { + background-color: #fefce8 !important; +} + +.rbc-event:nth-child(3) { + background-color: #f2f1ff !important; +} + +.rbc-event:nth-child(4) { + background-color: #fdf2fb !important; +} + +.rbc-event:nth-child(5) { + background-color: #e2f8ff !important; +} + +.rbc-event:nth-child(6) { + background-color: #fefce8 !important; +} + +.rbc-event:nth-child(7) { + background-color: #f2f1ff !important; +} + +.rbc-event:nth-child(8) { + background-color: #fdf2fb !important; +} + +.rbc-event-label { + color: gray !important; + margin-bottom: 5px !important; +} diff --git a/src/components/Announcements.tsx b/src/components/Announcements.tsx index 3b24e7ff7..4e3a46114 100644 --- a/src/components/Announcements.tsx +++ b/src/components/Announcements.tsx @@ -3,8 +3,9 @@ function Announcements() {

Annoucements

- Veiw All + Veiw All
+
diff --git a/src/components/BigCalendar.tsx b/src/components/BigCalendar.tsx new file mode 100644 index 000000000..f63bd3898 --- /dev/null +++ b/src/components/BigCalendar.tsx @@ -0,0 +1,34 @@ +"use client"; + +import { Calendar, momentLocalizer, View, Views } from "react-big-calendar"; +import moment from "moment"; +import { calendarEvents } from "@/lib/data"; +import "react-big-calendar/lib/css/react-big-calendar.css"; +import { useState } from "react"; + +const localizer = momentLocalizer(moment); + +const BigCalendar = () => { + const [view, setView] = useState(Views.WORK_WEEK); + + const handleOnChangeView = (selectedView: View) => { + setView(selectedView); + }; + + return ( + + ); +}; + +export default BigCalendar; diff --git a/src/components/Menu.tsx b/src/components/Menu.tsx index 176c534d7..852a53693 100644 --- a/src/components/Menu.tsx +++ b/src/components/Menu.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; import Image from "next/image"; +import { role } from "@/lib/data"; const menuItems = [ { @@ -115,16 +116,31 @@ const menuItems = [ ], }, ]; - function Menu() { return ( -
+
{menuItems.map((obj) => ( -
- +
+ {obj.title} - {obj.items.map((value) => ( + + {obj.items.map((item) => { + if (item.visible.includes(role)) { + return ( + + + {item.label} + + ); + } + })} + + {/* {obj.items.map((value) => ( {value.label} - ))} + ))} */}
))}
diff --git a/src/components/Pagination.tsx b/src/components/Pagination.tsx new file mode 100644 index 000000000..e38d8a788 --- /dev/null +++ b/src/components/Pagination.tsx @@ -0,0 +1,28 @@ +import React from "react"; + +function Pagination() { + return ( +
+ + +
+ + + + ... + +
+ + +
+ ); +} + +export default Pagination; diff --git a/src/components/Performance.tsx b/src/components/Performance.tsx new file mode 100644 index 000000000..2fefd9617 --- /dev/null +++ b/src/components/Performance.tsx @@ -0,0 +1,43 @@ +"use client"; + +import Image from "next/image"; +import { PieChart, Pie, Sector, Cell, ResponsiveContainer } from "recharts"; + +const data = [ + { name: "Group A", value: 92, fill: "#C3EBFA" }, + { name: "Group B", value: 8, fill: "#FAE27C" }, +]; + +function Performance() { + return ( +
+
+

Performance

+ +
+ + + + + +
+

9.2

+

of 10 max LTS

+
+

+ 1st Semester - 2nd Semester +

+
+ ); +} + +export default Performance; diff --git a/src/components/Table.tsx b/src/components/Table.tsx new file mode 100644 index 000000000..7e91183b4 --- /dev/null +++ b/src/components/Table.tsx @@ -0,0 +1,26 @@ +function Table({ + columns, + renderRow, + data, +}: { + columns: { header: string; accessor: string; className?: string }[]; + renderRow: (item: any) => React.ReactNode; + data: any[]; +}) { + return ( +
+ + + {columns.map((col) => ( + + ))} + + + {data.map((item) => renderRow(item))} +
+ {col.header} +
+ ); +} + +export default Table; diff --git a/src/components/TableSearch.tsx b/src/components/TableSearch.tsx new file mode 100644 index 000000000..492ba547f --- /dev/null +++ b/src/components/TableSearch.tsx @@ -0,0 +1,16 @@ +import Image from "next/image"; + +function TableSearch() { + return ( +
+ + +
+ ); +} + +export default TableSearch; diff --git a/src/lib/data.ts b/src/lib/data.ts index 5fcd9281e..026bfd46a 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -915,149 +915,148 @@ export const announcementsData = [ }, ]; - // YOU SHOULD CHANGE THE DATES OF THE EVENTS TO THE CURRENT DATE TO SEE THE EVENTS ON THE CALENDAR export const calendarEvents = [ { title: "Math", allDay: false, - start: new Date(2024, 7, 12, 8, 0), - end: new Date(2024, 7, 12, 8, 45), + start: new Date(2025, 2, 25, 8, 0), + end: new Date(2025, 2, 25, 8, 45), }, { title: "English", allDay: false, - start: new Date(2024, 7, 12, 9, 0), - end: new Date(2024, 7, 12, 9, 45), + start: new Date(2025, 2, 25, 9, 0), + end: new Date(2025, 2, 25, 9, 45), }, { title: "Biology", allDay: false, - start: new Date(2024, 7, 12, 10, 0), - end: new Date(2024, 7, 12, 10, 45), + start: new Date(2025, 2, 25, 10, 0), + end: new Date(2025, 2, 25, 10, 45), }, { title: "Physics", allDay: false, - start: new Date(2024, 7, 12, 11, 0), - end: new Date(2024, 7, 12, 11, 45), + start: new Date(2025, 2, 25, 11, 0), + end: new Date(2025, 2, 25, 11, 45), }, { title: "Chemistry", allDay: false, - start: new Date(2024, 7, 12, 13, 0), - end: new Date(2024, 7, 12, 13, 45), + start: new Date(2025, 2, 25, 13, 0), + end: new Date(2025, 2, 25, 13, 45), }, { title: "History", allDay: false, - start: new Date(2024, 7, 12, 14, 0), - end: new Date(2024, 7, 12, 14, 45), + start: new Date(2025, 2, 25, 14, 0), + end: new Date(2025, 2, 25, 14, 45), }, { title: "English", allDay: false, - start: new Date(2024, 7, 13, 9, 0), - end: new Date(2024, 7, 13, 9, 45), + start: new Date(2025, 2, 18, 9, 0), + end: new Date(2025, 2, 18, 9, 45), }, { title: "Biology", allDay: false, - start: new Date(2024, 7, 13, 10, 0), - end: new Date(2024, 7, 13, 10, 45), + start: new Date(2025, 2, 18, 10, 0), + end: new Date(2025, 2, 18, 10, 45), }, { title: "Physics", allDay: false, - start: new Date(2024, 7, 13, 11, 0), - end: new Date(2024, 7, 13, 11, 45), + start: new Date(2025, 2, 18, 11, 0), + end: new Date(2025, 2, 18, 11, 45), }, { title: "History", allDay: false, - start: new Date(2024, 7, 13, 14, 0), - end: new Date(2024, 7, 13, 14, 45), + start: new Date(2025, 2, 18, 14, 0), + end: new Date(2025, 2, 18, 14, 45), }, { title: "Math", allDay: false, - start: new Date(2024, 7, 14, 8, 0), - end: new Date(2024, 7, 14, 8, 45), + start: new Date(2025, 2, 14, 8, 0), + end: new Date(2025, 2, 14, 8, 45), }, { title: "Biology", allDay: false, - start: new Date(2024, 7, 14, 10, 0), - end: new Date(2024, 7, 14, 10, 45), + start: new Date(2025, 2, 14, 10, 0), + end: new Date(2025, 2, 14, 10, 45), }, { title: "Chemistry", allDay: false, - start: new Date(2024, 7, 14, 13, 0), - end: new Date(2024, 7, 14, 13, 45), + start: new Date(2025, 2, 14, 13, 0), + end: new Date(2025, 2, 14, 13, 45), }, { title: "History", allDay: false, - start: new Date(2024, 7, 14, 14, 0), - end: new Date(2024, 7, 13, 14, 45), + start: new Date(2025, 2, 14, 14, 0), + end: new Date(2025, 2, 13, 14, 45), }, { title: "English", allDay: false, - start: new Date(2024, 7, 15, 9, 0), - end: new Date(2024, 7, 15, 9, 45), + start: new Date(2025, 2, 15, 9, 0), + end: new Date(2025, 2, 15, 9, 45), }, { title: "Biology", allDay: false, - start: new Date(2024, 7, 15, 10, 0), - end: new Date(2024, 7, 15, 10, 45), + start: new Date(2025, 2, 15, 10, 0), + end: new Date(2025, 2, 15, 10, 45), }, { title: "Physics", allDay: false, - start: new Date(2024, 7, 15, 11, 0), - end: new Date(2024, 7, 15, 11, 45), + start: new Date(2025, 2, 15, 11, 0), + end: new Date(2025, 2, 15, 11, 45), }, { title: "History", allDay: false, - start: new Date(2024, 7, 15, 14, 0), - end: new Date(2024, 7, 15, 14, 45), + start: new Date(2025, 2, 15, 14, 0), + end: new Date(2025, 2, 15, 14, 45), }, { title: "Math", allDay: false, - start: new Date(2024, 7, 16, 8, 0), - end: new Date(2024, 7, 16, 8, 45), + start: new Date(2025, 2, 16, 8, 0), + end: new Date(2025, 2, 16, 8, 45), }, { title: "English", allDay: false, - start: new Date(2024, 7, 16, 9, 0), - end: new Date(2024, 7, 16, 9, 45), + start: new Date(2025, 2, 16, 9, 0), + end: new Date(2025, 2, 16, 9, 45), }, { title: "Physics", allDay: false, - start: new Date(2024, 7, 16, 11, 0), - end: new Date(2024, 7, 16, 11, 45), + start: new Date(2025, 2, 16, 11, 0), + end: new Date(2025, 2, 16, 11, 45), }, { title: "Chemistry", allDay: false, - start: new Date(2024, 7, 16, 13, 0), - end: new Date(2024, 7, 16, 13, 45), + start: new Date(2025, 2, 16, 13, 0), + end: new Date(2025, 2, 16, 13, 45), }, { title: "History", allDay: false, - start: new Date(2024, 7, 16, 14, 0), - end: new Date(2024, 7, 16, 14, 45), + start: new Date(2025, 2, 16, 14, 0), + end: new Date(2025, 2, 16, 14, 45), }, -]; \ No newline at end of file +];