{/* Logo Section */}
-
- {isCollapsed ? (
-

- ) : (
-

- )}
-
+
{/* MENU section - Only show when not collapsed */}
{!isCollapsed && (
@@ -67,24 +87,27 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen, isCollapsed }) => {

{
+ e.target.src = darkMode ? "/images/icons/grid.svg" : "/images/icons/grid.svg";
+ e.target.className = 'w-5'; // Remove filter if fallback
+ }}
/>
{!isCollapsed && "Dashboard"}
- {/* -----------singleBooking-------------- */}
+ {/* -----------singleBooking/Add token-------------- */}
-
-
Loading...
+
+
+// Handle theme loading state
+if (darkMode === undefined) {
+ return (
+
);
+}
+if (loading) return (
+
+);
- if (error) return
Error: {error}
;
+if (error) return (
+
+ Error: {error}
+
+);
- return (
- <>
-
setSearchQuery(e.target.value)}
- />
+return (
+
+
setSearchQuery(e.target.value)}
+ />
- {filteredEntries.length === 0 ? (
-
No entries found.
- ) : (
- <>
+ {filteredEntries.length === 0 ? (
+
+ No entries found.
+
+ ) : (
+ <>
+
- Token |
- Name |
- Status |
- Actions |
+ Token |
+ Name |
+ Status |
+ Actions |
{currentEntries.map((entry) => (
{entry.tokenNumber} |
{entry.patientName} |
{entry.status === "booked" ? "In-Queue" : entry.status}
@@ -151,13 +194,21 @@ export default function TokenTable({ statusFilter }) {
<>
@@ -168,28 +219,39 @@ export default function TokenTable({ statusFilter }) {
))}
|
+
-
-
-
- Page {currentPage} of {totalPages}
-
-
-
- >
- )}
- >
- );
+
+
+
+ Page {currentPage} of {totalPages}
+
+
+
+ >
+ )}
+
+);
}
\ No newline at end of file
diff --git a/src/app/components/charts/LineChart.jsx b/src/app/components/charts/LineChart.jsx
deleted file mode 100644
index 484b014..0000000
--- a/src/app/components/charts/LineChart.jsx
+++ /dev/null
@@ -1,158 +0,0 @@
-// components/LineChart.js
-'use client';
-import { useEffect } from 'react';
-import ApexCharts from 'apexcharts';
-
-const LineChart = () => {
- useEffect(() => {
- const chartThreeOptions = {
- series: [
- {
- name: "Sales",
- data: [180, 190, 170, 160, 175, 165, 170, 205, 230, 210, 240, 235],
- },
- {
- name: "Revenue",
- data: [40, 30, 50, 40, 55, 40, 70, 100, 110, 120, 150, 140],
- },
- ],
- legend: {
- show: false,
- position: "top",
- horizontalAlign: "left",
- },
- colors: ["#465FFF", "#9CB9FF"],
- chart: {
- fontFamily: "Outfit, sans-serif",
- height: 310,
- type: "area",
- toolbar: {
- show: false,
- },
- animations: {
- enabled: true,
- easing: 'easeinout',
- speed: 800,
- },
- },
- fill: {
- type: "gradient",
- gradient: {
- shadeIntensity: 1,
- opacityFrom: 0.55,
- opacityTo: 0,
- stops: [0, 90, 100],
- },
- },
- stroke: {
- curve: "straight",
- width: [2, 2],
- dashArray: [0, 0],
- },
- markers: {
- size: 0,
- hover: {
- size: 5,
- }
- },
- labels: {
- show: false,
- position: "top",
- },
- grid: {
- borderColor: "#F1F1F1",
- xaxis: {
- lines: {
- show: false,
- },
- },
- yaxis: {
- lines: {
- show: true,
- },
- },
- },
- dataLabels: {
- enabled: false,
- },
- tooltip: {
- enabled: true,
- x: {
- format: "MMM yyyy",
- },
- y: {
- formatter: function(val) {
- return "$" + val;
- }
- },
- marker: {
- show: true,
- },
- },
- xaxis: {
- type: "category",
- categories: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
- axisBorder: {
- show: false,
- },
- axisTicks: {
- show: false,
- },
- tooltip: {
- enabled: false,
- },
- labels: {
- style: {
- colors: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- }
- },
- yaxis: {
- title: {
- text: "Amount ($)",
- style: {
- color: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- },
- labels: {
- formatter: function(val) {
- return "$" + val;
- },
- style: {
- colors: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- }
- },
- };
-
- const chart = new ApexCharts(document.querySelector("#chartThree"), chartThreeOptions);
- chart.render();
-
- return () => {
- chart.destroy();
- };
- }, []);
-
- return
;
-};
-
-export default LineChart;
\ No newline at end of file
diff --git a/src/app/components/charts/chart-01.jsx b/src/app/components/charts/chart-01.jsx
deleted file mode 100644
index bf3cbc2..0000000
--- a/src/app/components/charts/chart-01.jsx
+++ /dev/null
@@ -1,142 +0,0 @@
-// components/charts/chart-01.jsx
-'use client';
-import { useEffect } from 'react';
-import ApexCharts from 'apexcharts';
-
-const Chart01 = () => {
- useEffect(() => {
- const chartOneOptions = {
- series: [
- {
- name: "Sales",
- data: [168, 385, 201, 298, 187, 195, 291, 110, 215, 390, 280, 112],
- },
- ],
- colors: ["#465fff"],
- chart: {
- fontFamily: "Outfit, sans-serif",
- type: "bar",
- height: 180,
- toolbar: {
- show: false,
- },
- animations: {
- enabled: true,
- easing: 'easeinout',
- speed: 800,
- },
- },
- plotOptions: {
- bar: {
- horizontal: false,
- columnWidth: "39%",
- borderRadius: 5,
- borderRadiusApplication: "end",
- },
- },
- dataLabels: {
- enabled: false,
- },
- stroke: {
- show: true,
- width: 4,
- colors: ["transparent"],
- },
- xaxis: {
- categories: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
- axisBorder: {
- show: false,
- },
- axisTicks: {
- show: false,
- },
- labels: {
- style: {
- colors: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- }
- },
- legend: {
- show: true,
- position: "top",
- horizontalAlign: "left",
- fontFamily: "Outfit, sans-serif",
- markers: {
- radius: 12,
- },
- itemMargin: {
- horizontal: 10,
- }
- },
- yaxis: {
- title: {
- text: "Amount ($)",
- style: {
- color: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- },
- labels: {
- formatter: function(val) {
- return "$" + val;
- },
- style: {
- colors: "#6B7280",
- fontSize: "12px",
- fontFamily: "Outfit, sans-serif",
- }
- }
- },
- grid: {
- borderColor: "#F1F1F1",
- yaxis: {
- lines: {
- show: true,
- },
- },
- xaxis: {
- lines: {
- show: false,
- },
- },
- },
- fill: {
- opacity: 1,
- },
- tooltip: {
- y: {
- formatter: function(val) {
- return "$" + val;
- }
- }
- },
- };
-
- const chart = new ApexCharts(document.querySelector("#chartOne"), chartOneOptions);
- chart.render();
-
- return () => {
- chart.destroy();
- };
- }, []);
-
- return
;
-};
-
-export default Chart01;
\ No newline at end of file
diff --git a/src/app/components/charts/chart-02.jsx b/src/app/components/charts/chart-02.jsx
deleted file mode 100644
index 2c09c3a..0000000
--- a/src/app/components/charts/chart-02.jsx
+++ /dev/null
@@ -1,100 +0,0 @@
-// components/charts/chart-02.jsx
-'use client';
-import { useEffect } from 'react';
-import ApexCharts from 'apexcharts';
-
-const Chart02 = () => {
- useEffect(() => {
- const chartTwoOptions = {
- series: [75.55],
- colors: ["#465FFF"],
- chart: {
- fontFamily: "Outfit, sans-serif",
- type: "radialBar",
- height: 330,
- sparkline: {
- enabled: true,
- },
- animations: {
- enabled: true,
- easing: 'easeinout',
- speed: 800,
- },
- },
- plotOptions: {
- radialBar: {
- startAngle: -90,
- endAngle: 90,
- hollow: {
- size: "80%",
- },
- track: {
- background: "#E4E7EC",
- strokeWidth: "100%",
- margin: 5,
- },
- dataLabels: {
- name: {
- show: false,
- },
- value: {
- fontSize: "36px",
- fontWeight: "600",
- offsetY: 60,
- color: "#1D2939",
- fontFamily: "Outfit, sans-serif",
- formatter: function (val) {
- return val + "%";
- },
- },
- },
- },
- },
- fill: {
- type: "gradient",
- gradient: {
- shade: "dark",
- shadeIntensity: 0.5,
- gradientToColors: ["#465FFF"],
- inverseColors: false,
- opacityFrom: 1,
- opacityTo: 0.8,
- stops: [0, 100],
- },
- },
- stroke: {
- lineCap: "round",
- },
- labels: ["Progress"],
- responsive: [{
- breakpoint: 768,
- options: {
- chart: {
- height: 280,
- },
- plotOptions: {
- radialBar: {
- dataLabels: {
- value: {
- fontSize: "28px",
- offsetY: 50,
- },
- },
- },
- },
- },
- }],
- };
-
- const chart = new ApexCharts(document.querySelector("#chartTwo"), chartTwoOptions);
- chart.render();
-
- return () => {
- chart.destroy();
- };
- }, []);
-
- return
;
-};
-
-export default Chart02;
\ No newline at end of file
diff --git a/src/app/components/common/GridShape.js b/src/app/components/common/GridShape.js
deleted file mode 100644
index 8905763..0000000
--- a/src/app/components/common/GridShape.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import Image from "next/image";
-
-export default function GridShape() {
- return (
- <>
-
-
-
-
-
-
- >
- );
-}
\ No newline at end of file
diff --git a/src/app/components/partials/alert/alert-error.js b/src/app/components/partials/alert/alert-error.js
deleted file mode 100644
index f30785b..0000000
--- a/src/app/components/partials/alert/alert-error.js
+++ /dev/null
@@ -1,92 +0,0 @@
-'use client';
-
-export default function SuccessMessage() {
- return (
- <>
- {/* First Message with Link */}
-
-
-
-
-
-
- Success Message
-
-
- You can insert a description for the message here. The text relates
- to the action that has been performed.
-
-
- Learn more
-
-
-
-
-
- {/* Second Message without Link */}
-
-
-
-
-
-
- Success Message
-
-
- You can insert a description for the message here. The text relates
- to the action that has been performed.
-
-
-
-
- >
- );
-}
diff --git a/src/app/components/partials/alert/alert-info.js b/src/app/components/partials/alert/alert-info.js
deleted file mode 100644
index e1e4b8d..0000000
--- a/src/app/components/partials/alert/alert-info.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import React from 'react';
-
-const AlertInfo = () => {
- return (
-
- {/* First Alert with Learn More link */}
-
-
-
-
-
-
- Success Message
-
-
-
- You can insert a description for the message here.The text relates to
- the action that has been performed.
-
-
-
- Learn more
-
-
-
-
-
- {/* Second Alert without Learn More link */}
-
-
-
-
-
-
- Success Message
-
-
-
- You can insert a description for the message here.The text relates to
- the action that has been performed.
-
-
-
-
-
- );
-};
-
-export default AlertInfo;
\ No newline at end of file
diff --git a/src/app/components/partials/alert/alert-success.js b/src/app/components/partials/alert/alert-success.js
deleted file mode 100644
index 124fb3f..0000000
--- a/src/app/components/partials/alert/alert-success.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// app/alert-success/page.js
-export default function AlertSuccessPage() {
- return (
-
- {/* Alert 1 */}
-
-
-
-
-
-
- Success Message
-
-
- You can insert a description for the message here. The text relates to
- the action that has been performed.
-
-
- Learn more
-
-
-
-
-
- {/* Alert 2 (without link) */}
-
-
-
-
-
-
- Success Message
-
-
- You can insert a description for the message here. The text relates to
- the action that has been performed.
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/components/partials/alert/alert-warning.js b/src/app/components/partials/alert/alert-warning.js
deleted file mode 100644
index fc5f1f2..0000000
--- a/src/app/components/partials/alert/alert-warning.js
+++ /dev/null
@@ -1,79 +0,0 @@
-"use client";
-
-export default function AlertWarning() {
- return (
-
- {/* Alert 1 */}
-
-
-
-
-
-
- Warning Message
-
-
- You can insert a description for the message here. The text
- relates to the action that has been performed.
-
-
- Learn more
-
-
-
-
-
- {/* Alert 2 */}
-
-
-
-
-
-
- Warning Message
-
-
- You can insert a description for the message here. The text
- relates to the action that has been performed.
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/components/partials/avatar/avatar01.js b/src/app/components/partials/avatar/avatar01.js
deleted file mode 100644
index 73aed18..0000000
--- a/src/app/components/partials/avatar/avatar01.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// components/partials/avatar/Avatar01.tsx
-import React from 'react';
-import Image from 'next/image';
-
-const Avatar01 = () => {
- const sizes = [
- { container: 'h-6 w-6', max: 'max-w-6' },
- { container: 'h-8 w-8', max: 'max-w-8' },
- { container: 'h-10 w-10', max: 'max-w-10' },
- { container: 'h-12 w-12', max: 'max-w-12' },
- { container: 'h-14 w-14', max: 'max-w-14' },
- { container: 'h-16 w-16', max: 'max-w-16' },
- ];
-
- return (
-
- {sizes.map((size, index) => (
-
-
-
- ))}
-
- );
-};
-
-export default Avatar01;
\ No newline at end of file
diff --git a/src/app/components/partials/avatar/avatar02.js b/src/app/components/partials/avatar/avatar02.js
deleted file mode 100644
index 225bde8..0000000
--- a/src/app/components/partials/avatar/avatar02.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// components/partials/avatar/Avatar02.tsx
-import React from 'react';
-import Image from 'next/image';
-
-const Avatar02 = () => {
- const sizes = [
- { container: 'h-6 w-6', indicator: 'h-1.5 w-1.5' },
- { container: 'h-8 w-8', indicator: 'h-2 w-2' },
- { container: 'h-10 w-10', indicator: 'h-2.5 w-2.5' },
- { container: 'h-12 w-12', indicator: 'h-3 w-3' },
- { container: 'h-14 w-14', indicator: 'h-3.5 w-3.5' },
- { container: 'h-16 w-16', indicator: 'h-4 w-4' },
- ];
-
- return (
-
- {sizes.map((size, index) => (
-
-
-
-
- ))}
-
- );
-};
-
-export default Avatar02;
\ No newline at end of file
diff --git a/src/app/components/partials/avatar/avatar03.js b/src/app/components/partials/avatar/avatar03.js
deleted file mode 100644
index 4fd45db..0000000
--- a/src/app/components/partials/avatar/avatar03.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// components/partials/avatar/Avatar03.tsx
-import React from 'react';
-import Image from 'next/image';
-
-const Avatar03 = () => {
- const sizes = [
- { container: 'h-6 w-6', indicator: 'h-1.5 w-1.5' },
- { container: 'h-8 w-8', indicator: 'h-2 w-2' },
- { container: 'h-10 w-10', indicator: 'h-2.5 w-2.5' },
- { container: 'h-12 w-12', indicator: 'h-3 w-3' },
- { container: 'h-14 w-14', indicator: 'h-3.5 w-3.5' },
- { container: 'h-16 w-16', indicator: 'h-4 w-4' },
- ];
-
- return (
-
- {sizes.map((size, index) => (
-
-
-
-
- ))}
-
- );
-};
-
-export default Avatar03;
\ No newline at end of file
diff --git a/src/app/components/partials/avatar/avatar04.js b/src/app/components/partials/avatar/avatar04.js
deleted file mode 100644
index 3e5f2c5..0000000
--- a/src/app/components/partials/avatar/avatar04.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// components/partials/avatar/Avatar04.tsx
-import React from 'react';
-import Image from 'next/image';
-
-const Avatar04 = () => {
- const sizes = [
- { container: 'h-6 w-6', indicator: 'h-1.5 w-1.5' },
- { container: 'h-8 w-8', indicator: 'h-2 w-2' },
- { container: 'h-10 w-10', indicator: 'h-2.5 w-2.5' },
- { container: 'h-12 w-12', indicator: 'h-3 w-3' },
- { container: 'h-14 w-14', indicator: 'h-3.5 w-3.5' },
- { container: 'h-16 w-16', indicator: 'h-4 w-4' },
- ];
-
- return (
-
- {sizes.map((size, index) => (
-
-
-
-
- ))}
-
- );
-};
-
-export default Avatar04;
\ No newline at end of file
diff --git a/src/app/components/partials/badge/Badge01.js b/src/app/components/partials/badge/Badge01.js
deleted file mode 100644
index e59118e..0000000
--- a/src/app/components/partials/badge/Badge01.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// components/partials/badge/Badge01.tsx
-import React from 'react';
-
-const Badge01 = () => {
- return (
-
- {/* Primary Badge */}
-
- Primary
-
-
- {/* Success Badge */}
-
- Success
-
-
- {/* Error Badge */}
-
- Error
-
-
- {/* Warning Badge */}
-
- Warning
-
-
- {/* Info Badge */}
-
- Info
-
-
- {/* Light Badge */}
-
- Light
-
-
- {/* Dark Badge */}
-
- Dark
-
-
- );
-};
-
-export default Badge01;
\ No newline at end of file
diff --git a/src/app/components/partials/badge/Badge02.js b/src/app/components/partials/badge/Badge02.js
deleted file mode 100644
index fac723e..0000000
--- a/src/app/components/partials/badge/Badge02.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// components/partials/badge/Badge02.tsx
-import React from 'react';
-
-const Badge02 = () => {
- return (
-
- {/* Primary Badge */}
-
- Primary
-
-
- {/* Success Badge */}
-
- Success
-
-
- {/* Error Badge */}
-
- Error
-
-
- {/* Warning Badge */}
-
- Warning
-
-
- {/* Info Badge */}
-
- Info
-
-
- {/* Light Badge */}
-
- Light
-
-
- {/* Dark Badge */}
-
- Dark
-
-
- );
-};
-
-export default Badge02;
\ No newline at end of file
diff --git a/src/app/components/partials/badge/Badge03.js b/src/app/components/partials/badge/Badge03.js
deleted file mode 100644
index 97620d4..0000000
--- a/src/app/components/partials/badge/Badge03.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// components/partials/badge/Badge03.tsx
-import React from 'react';
-
-const PlusIcon = () => (
-
-);
-
-const Badge03 = () => {
- return (
-
- {/* Primary Badge */}
-
-
- Primary
-
-
- {/* Success Badge */}
-
-
- Success
-
-
- {/* Error Badge */}
-
-
- Error
-
-
- {/* Warning Badge */}
-
-
- Warning
-
-
- {/* Info Badge */}
-
-
- Info
-
-
- {/* Light Badge */}
-
-
- Light
-
-
- {/* Dark Badge */}
-
-
- Dark
-
-
- );
-};
-
-export default Badge03;
\ No newline at end of file
diff --git a/src/app/components/partials/badge/Badge04.js b/src/app/components/partials/badge/Badge04.js
deleted file mode 100644
index 60732cd..0000000
--- a/src/app/components/partials/badge/Badge04.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// components/partials/badge/Badge04.tsx
-import React from 'react';
-
-const PlusIcon = () => (
-
-);
-
-const Badge04 = () => {
- return (
-
- {/* Primary Badge */}
-
-
- Primary
-
-
- {/* Success Badge */}
-
-
- Success
-
-
- {/* Error Badge */}
-
-
- Error
-
-
- {/* Warning Badge */}
-
-
- Warning
-
-
- {/* Info Badge */}
-
-
- Info
-
-
- {/* Light Badge */}
-
-
- Light
-
-
- {/* Dark Badge */}
-
-
- Dark
-
-
- );
-};
-
-export default Badge04;
\ No newline at end of file
diff --git a/src/app/components/partials/badge/Badge05.js b/src/app/components/partials/badge/Badge05.js
deleted file mode 100644
index 66659a9..0000000
--- a/src/app/components/partials/badge/Badge05.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// components/partials/badge/Badge05.tsx
-import React from 'react';
-
-const PlusIcon = () => (
-
-);
-
-const Badge05 = () => {
- return (
-
- {/* Primary Badge */}
-
- Primary
-
-
-
- {/* Success Badge */}
-
- Success
-
-
-
- {/* Error Badge */}
-
- Error
-
-
-
- {/* Warning Badge */}
-
- Warning
-
-
-
- {/* Info Badge */}
-
- Info
-
-
-
- {/* Light Badge */}
-
- Light
-
-
-
- {/* Dark Badge */}
-
- Dark
-
-
-
- );
-};
-
-export default Badge05;
diff --git a/src/app/components/partials/badge/Badge06.js b/src/app/components/partials/badge/Badge06.js
deleted file mode 100644
index 46897ae..0000000
--- a/src/app/components/partials/badge/Badge06.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import React from 'react';
-
-const PlusIcon = () => (
-
-);
-
-const Badge06 = () => {
- return (
-
- {/* Primary Badge */}
-
- Primary
-
-
-
- {/* Success Badge */}
-
- Success
-
-
-
- {/* Error Badge */}
-
- Error
-
-
-
- {/* Warning Badge */}
-
- Warning
-
-
-
- {/* Info Badge */}
-
- Info
-
-
-
- {/* Light Badge */}
-
- Light
-
-
-
- {/* Dark Badge */}
-
- Dark
-
-
-
- );
-};
-
-export default Badge06;
diff --git a/src/app/components/partials/grid-images/image01.js b/src/app/components/partials/grid-images/image01.js
deleted file mode 100644
index fbf490a..0000000
--- a/src/app/components/partials/grid-images/image01.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import Image from 'next/image';
-
-const Image01 = () => {
- return (
-
- );
-};
-
-export default Image01;
\ No newline at end of file
diff --git a/src/app/components/partials/grid-images/image02.js b/src/app/components/partials/grid-images/image02.js
deleted file mode 100644
index 2befff8..0000000
--- a/src/app/components/partials/grid-images/image02.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import Image from 'next/image';
-
-const Image02 = () => {
- return (
-
- );
-};
-
-export default Image02;
\ No newline at end of file
diff --git a/src/app/components/partials/grid-images/image03.js b/src/app/components/partials/grid-images/image03.js
deleted file mode 100644
index 87b6bd2..0000000
--- a/src/app/components/partials/grid-images/image03.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import Image from 'next/image';
-
-const Image03 = () => {
- return (
-
- );
-};
-
-export default Image03;
\ No newline at end of file
diff --git a/src/app/components/partials/header.jsx b/src/app/components/partials/header.jsx
index 8f3d65a..2376941 100644
--- a/src/app/components/partials/header.jsx
+++ b/src/app/components/partials/header.jsx
@@ -1,90 +1,105 @@
"use client";
+import { useTheme } from "../../context/ThemeContext";
export default function Header({
currentToken,
previousToken,
nextToken,
missedTokens,
- entries = [] // Add entries prop to calculate counts
+ entries = []
}) {
- // Calculate counts from entries
const totalTokens = entries.length;
const doneTokens = entries.filter(entry => entry.status === "done").length;
const missedTokensCount = entries.filter(entry => entry.status === "missed").length;
const inQueueTokens = entries.filter(entry => entry.status === "booked").length;
+ const { darkMode } = useTheme();
- return (
-
-
-
-
- {/* ----------Total Tokens Card---------------- */}
-
-
Total Tokens
-
-
{totalTokens}
-
- +{inQueueTokens} in queue
-
-
-
+
+
+
+return (
+
+
+
+ {/* ----------Total Tokens Card---------------- */}
+
+
Total Tokens
+
+
{totalTokens}
+
+ +{inQueueTokens} in queue
+
-
- {/* ----------Done Tokens Card---------------- */}
-
-
Done
-
-
{doneTokens}
-
-
- {totalTokens > 0 ? Math.round((doneTokens/totalTokens)*100) : 0}%
- of total
-
-
-
+
+
+
+ {/* ----------Done Tokens Card---------------- */}
+
+
Done
+
+
{doneTokens}
+
+
+ {totalTokens > 0 ? Math.round((doneTokens/totalTokens)*100) : 0}%
+ of total
+
-
- {/* ----------Missed Tokens Card---------------- */}
-
-
Missed Tokens
-
-
{missedTokensCount}
-
- {missedTokensCount > 0 ? (
- {missedTokens}
- ) : (
- "All attended"
- )}
-
-
-
+
+
+
+ {/* ----------Missed Tokens Card---------------- */}
+
+
Missed Tokens
+
+
{missedTokensCount}
+
+ {missedTokensCount > 0 ? (
+ {missedTokens}
+ ) : (
+ "All attended"
+ )}
+
-
- {/* ----------Current Token Card---------------- */}
-
-
Current Token
-
-
- {currentToken || "---"}
-
-
- Prev: {previousToken || "---"}
- Next: {nextToken || "---"}
-
+
+
+
+ {/* ----------Current Token Card---------------- */}
+
+
Current Token
+
+
+ {currentToken || "---"}
+
+
+ Prev: {previousToken || "---"}
+ Next: {nextToken || "---"}
-
+
- );
+
+);
}
\ No newline at end of file
diff --git a/src/app/components/partials/table/TableOne.jsx b/src/app/components/partials/table/TableOne.jsx
deleted file mode 100644
index 75cbe82..0000000
--- a/src/app/components/partials/table/TableOne.jsx
+++ /dev/null
@@ -1,203 +0,0 @@
-import Image from 'next/image';
-
-const TableOne = () => {
- // Table data
- const tableData = [
- {
- id: 1,
- token: "1",
- name: "John Doe",
- status: {
- text: "Done",
- variant: "success",
- color: "text-success-600",
- bg: "bg-success-50",
- dark: {
- color: "dark:text-success-500",
- bg: "dark:bg-success-500/15"
- }
- }
- },
- {
- id: 2,
- token: "1",
- name: "John Doe",
- status: {
- text: "In-Queue",
- variant: "warning",
- color: "text-warning-600",
- bg: "bg-warning-50",
- dark: {
- color: "dark:text-orange-400",
- bg: "dark:bg-warning-500/15"
- }
- }
- },
- {
- id: 3,
- token: "1",
- name: "John Doe",
- status: {
- text: "Cancelled",
- variant: "error",
- color: "text-error-600",
- bg: "bg-error-50",
- dark: {
- color: "dark:text-error-500",
- bg: "dark:bg-error-500/15"
- }
- }
- },
- {
- id: 4,
- token: "1",
- name: "John Doe",
- status: {
- text: "Done",
- variant: "success",
- color: "text-success-600",
- bg: "bg-success-50",
- dark: {
- color: "dark:text-success-500",
- bg: "dark:bg-success-500/15"
- }
- }
- },
- {
- id: 5,
- token: "1",
- name: "John Doe",
- status: {
- text: "In-Queue",
- variant: "warning",
- color: "text-warning-600",
- bg: "bg-warning-50",
- dark: {
- color: "dark:text-orange-400",
- bg: "dark:bg-warning-500/15"
- }
- }
- },
- {
- id: 6,
- token: "1",
- name: "John Doe",
- status: {
- text: "Cancelled",
- variant: "error",
- color: "text-error-600",
- bg: "bg-error-50",
- dark: {
- color: "dark:text-error-500",
- bg: "dark:bg-error-500/15"
- }
- }
- }
- ];
-
- // Action button component
- const ActionButton = ({ type }) => (
-
-
- {type}
-
- );
-
- return (
-
-
-
- {/* Table Header */}
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
-
- {/* Table Body */}
-
- {tableData.map((item) => (
-
- {/* Token Column */}
-
-
- |
-
- {/* Name Column */}
-
-
-
- {item.name}
-
- {/* Mobile Actions */}
-
-
- |
-
- {/* Status Column */}
-
-
-
- {item.status.text}
-
-
- |
-
- {/* Options Column (Desktop) */}
-
-
- |
-
- ))}
-
-
-
-
- );
-};
-
-export default TableOne;
\ No newline at end of file
diff --git a/src/app/components/partials/table/TableSix.jsx b/src/app/components/partials/table/TableSix.jsx
deleted file mode 100644
index 3c8253d..0000000
--- a/src/app/components/partials/table/TableSix.jsx
+++ /dev/null
@@ -1,240 +0,0 @@
-import Image from 'next/image';
-
-const TableSix = () => {
- // Table data array
- const tableData = [
- {
- id: 1,
- user: {
- name: "Lindsey Curtis",
- role: "Web Designer",
- avatar: "/images/user/user-17.jpg"
- },
- project: "Agency Website",
- team: [
- "/images/user/user-22.jpg",
- "/images/user/user-23.jpg",
- "/images/user/user-24.jpg"
- ],
- status: {
- text: "Active",
- variant: "success"
- },
- budget: "3.9K"
- },
- {
- id: 2,
- user: {
- name: "Kaiya George",
- role: "Project Manager",
- avatar: "/images/user/user-18.jpg"
- },
- project: "Technology",
- team: [
- "/images/user/user-25.jpg",
- "/images/user/user-26.jpg"
- ],
- status: {
- text: "Pending",
- variant: "warning"
- },
- budget: "24.9K"
- },
- {
- id: 3,
- user: {
- name: "Zain Geidt",
- role: "Content Writer",
- avatar: "/images/user/user-19.jpg"
- },
- project: "Blog Writing",
- team: [
- "/images/user/user-27.jpg"
- ],
- status: {
- text: "Active",
- variant: "success"
- },
- budget: "12.7K"
- },
- {
- id: 4,
- user: {
- name: "Abram Schleifer",
- role: "Digital Marketer",
- avatar: "/images/user/user-20.jpg"
- },
- project: "Social Media",
- team: [
- "/images/user/user-28.jpg",
- "/images/user/user-29.jpg",
- "/images/user/user-30.jpg"
- ],
- status: {
- text: "Cancel",
- variant: "error"
- },
- budget: "2.8K"
- },
- {
- id: 5,
- user: {
- name: "Carla George",
- role: "Front-end Developer",
- avatar: "/images/user/user-21.jpg"
- },
- project: "Website",
- team: [
- "/images/user/user-31.jpg",
- "/images/user/user-32.jpg",
- "/images/user/user-33.jpg"
- ],
- status: {
- text: "Active",
- variant: "success"
- },
- budget: "4.5K"
- }
- ];
-
- // Status style variants
- const statusVariants = {
- success: "bg-success-50 text-success-700 dark:bg-success-500/15 dark:text-success-500",
- warning: "bg-warning-50 text-warning-700 dark:bg-warning-500/15 dark:text-warning-400",
- error: "bg-error-50 text-error-700 dark:bg-error-500/15 dark:text-error-500"
- };
-
- return (
-
-
-
- {/* Table Header */}
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
-
- {/* Table Body */}
-
- {tableData.map((item) => (
-
- {/* User Column */}
-
-
-
-
-
-
-
-
- {item.user.name}
-
-
- {item.user.role}
-
-
-
-
- |
-
- {/* Project Column */}
-
-
- |
-
- {/* Team Column */}
-
-
-
- {item.team.map((member, index) => (
-
-
-
- ))}
-
-
- |
-
- {/* Status Column */}
-
-
-
- {item.status.text}
-
-
- |
-
- {/* Budget Column */}
-
-
- |
-
- ))}
-
-
-
-
- );
-};
-
-export default TableSix;
\ No newline at end of file
diff --git a/src/app/components/partials/video/video-01.jsx b/src/app/components/partials/video/video-01.jsx
deleted file mode 100644
index d8e0be6..0000000
--- a/src/app/components/partials/video/video-01.jsx
+++ /dev/null
@@ -1,18 +0,0 @@
-'use client';
-
-export default function YouTubeVideo() {
- return (
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/components/partials/video/video-02.jsx b/src/app/components/partials/video/video-02.jsx
deleted file mode 100644
index e5cb078..0000000
--- a/src/app/components/partials/video/video-02.jsx
+++ /dev/null
@@ -1,21 +0,0 @@
-'use client';
-
-export default function YouTubeVideo4x3({
- videoId = "dQw4w9WgXcQ",
- title = "YouTube video player"
-}) {
- return (
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/components/partials/video/video-04.jsx b/src/app/components/partials/video/video-04.jsx
deleted file mode 100644
index 9da2a4d..0000000
--- a/src/app/components/partials/video/video-04.jsx
+++ /dev/null
@@ -1,22 +0,0 @@
-'use client';
-
-export default function SquareYouTubeVideo({
- videoId = "dQw4w9WgXcQ",
- title = "YouTube video player",
- className = ""
-}) {
- return (
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/context/AuthContext.js b/src/app/context/AuthContext.js
index 01881e5..6f70650 100644
--- a/src/app/context/AuthContext.js
+++ b/src/app/context/AuthContext.js
@@ -41,7 +41,7 @@ export const AuthProvider = ({ children }) => {
if (error.code === 401) {
localStorage.removeItem("isLoggedIn");
setIsAuthenticated(false);
- router.push("/signup");
+ router.push("/");
}
} finally {
setLoading(false);
diff --git a/src/app/context/DashboardContext.js b/src/app/context/DashboardContext.js
deleted file mode 100644
index e69de29..0000000
diff --git a/src/app/context/ThemeContext.js b/src/app/context/ThemeContext.js
index 789303a..764ecdc 100644
--- a/src/app/context/ThemeContext.js
+++ b/src/app/context/ThemeContext.js
@@ -1,11 +1,11 @@
-// src/context/ThemeContext.js
"use client";
import { createContext, useContext, useState, useEffect } from "react";
const ThemeContext = createContext();
export function ThemeProvider({ children }) {
- const [darkMode, setDarkMode] = useState(false);
+ // Initialize with undefined to detect client-side
+ const [darkMode, setDarkMode] = useState(undefined);
useEffect(() => {
// Check for saved preference or system preference
@@ -14,6 +14,8 @@ export function ThemeProvider({ children }) {
setDarkMode(savedMode === 'true');
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
setDarkMode(true);
+ } else {
+ setDarkMode(false); // Explicitly set light mode if no preference
}
}, []);
diff --git a/src/app/dashboard/page.js b/src/app/dashboard/page.js
index 248ce64..16a2c5a 100644
--- a/src/app/dashboard/page.js
+++ b/src/app/dashboard/page.js
@@ -6,25 +6,28 @@ import { useEffect } from "react";
import { useTheme } from "../context/ThemeContext";
import EntriesTable from "../pages/entries/EntriesTable";
-
export default function DashboardPage() {
-
const router = useRouter();
const { isAuthenticated, loading, userRole } = useAuth();
const { darkMode } = useTheme();
useEffect(() => {
if (!loading && !isAuthenticated) {
- router.push("/signup");
+ router.push("/");
}
}, [isAuthenticated, loading, router]);
- if (loading) {
+ // Handle theme loading state
+ if (darkMode === undefined || loading) {
return (
@@ -37,8 +40,12 @@ export default function DashboardPage() {
}
return (
-
-
-
+
+
+
+
+
);
}
\ No newline at end of file
diff --git a/src/app/lib/config.js b/src/app/lib/config.js
index 68ac91d..7f4fb0e 100644
--- a/src/app/lib/config.js
+++ b/src/app/lib/config.js
@@ -6,6 +6,6 @@
// lib/config.js
export const DATABASE_ID = "67e1452b00016444b37f";
-export const COLLECTION_ID = "67fe4029000f7e0a7b92";
+export const COLLECTION_ID = "681c367b0016f9ba0e8e";
export const SETTINGS_COLLECTION_ID = "settings";
export const AVG_CONSULTATION_KEY = "avg_consultation";
\ No newline at end of file
diff --git a/src/app/page.js b/src/app/page.js
index 67ceff5..012654c 100644
--- a/src/app/page.js
+++ b/src/app/page.js
@@ -1,32 +1,152 @@
-// src/app/page.js
-"use client"; // Mark this as a client component
-
+"use client";
import { useRouter } from "next/navigation";
-import { useAuth } from "./context/AuthContext"; // Import useAuth
-import { useEffect } from "react"; // Import useEffect
+import { useAuth } from "./context/AuthContext";
+import { useState, useEffect } from "react";
+import Link from "next/link";
+import Button1 from "./ui/buttons/button1";
+import { account, ID } from "./lib/appwrite";
-export default function Home() {
+export default function AuthPage() {
const router = useRouter();
- const { isAuthenticated, loading } = useAuth();
+ const { isAuthenticated, loading: authLoading, setIsAuthenticated } = useAuth();
+ const [isLoginForm, setIsLoginForm] = useState(true);
+ const [darkMode, setDarkMode] = useState(false);
+ const [loading, setLoading] = useState(false);
+ const [showPassword, setShowPassword] = useState(false);
+
+ // Form states
+ const [loginData, setLoginData] = useState({
+ email: "",
+ password: "",
+ rememberMe: false,
+ });
+
+ const [signupData, setSignupData] = useState({
+ fname: "",
+ lname: "",
+ email: "",
+ password: "",
+ agreeTerms: false,
+ });
+
+ const [errors, setErrors] = useState({
+ agreeTerms: "",
+ general: "",
+ });
useEffect(() => {
- if (!loading) {
- if (isAuthenticated) {
- router.push("/dashboard");
- } else {
- router.push("/signup");
- }
+ if (!authLoading && isAuthenticated) {
+ router.push("/dashboard");
}
- }, [isAuthenticated, loading, router]);
+ }, [isAuthenticated, authLoading, router]);
- if (loading) {
+ const handleLoginChange = (e) => {
+ const { name, value, type, checked } = e.target;
+ setLoginData({
+ ...loginData,
+ [name]: type === "checkbox" ? checked : value,
+ });
+ };
+
+ const handleSignupChange = (e) => {
+ const { name, value, type, checked } = e.target;
+ setSignupData({
+ ...signupData,
+ [name]: type === "checkbox" ? checked : value,
+ });
+ if (name === "agreeTerms") {
+ setErrors({ ...errors, agreeTerms: "" });
+ }
+ };
+
+ const validateSignupForm = () => {
+ let isValid = true;
+ const newErrors = { ...errors };
+
+ if (!signupData.agreeTerms) {
+ newErrors.agreeTerms = "You must agree to the terms and conditions";
+ isValid = false;
+ } else {
+ newErrors.agreeTerms = "";
+ }
+
+ setErrors(newErrors);
+ return isValid;
+ };
+
+ const handleLogin = async (e) => {
+ e.preventDefault();
+ setLoading(true);
+ setErrors({ ...errors, general: "" });
+
+ try {
+ const session = await account.createEmailPasswordSession(
+ loginData.email,
+ loginData.password
+ );
+
+ if (session) {
+ const user = await account.get();
+ if (user) {
+ localStorage.setItem("isLoggedIn", "true");
+ setIsAuthenticated(true);
+ router.push("/dashboard");
+ }
+ }
+ } catch (error) {
+ let errorMessage = 'Login failed. Please try again.';
+ if (error.type === 'user_invalid_credentials') {
+ errorMessage = 'Invalid email or password';
+ } else if (error.type === 'general_argument_invalid') {
+ errorMessage = 'Invalid email format';
+ }
+ setErrors({ ...errors, general: errorMessage });
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleSignup = async (e) => {
+ e.preventDefault();
+
+ if (!validateSignupForm()) {
+ return;
+ }
+
+ setLoading(true);
+ setErrors({ ...errors, general: "" });
+
+ try {
+ await account.create(
+ ID.unique(),
+ signupData.email,
+ signupData.password,
+ `${signupData.fname} ${signupData.lname}`
+ );
+ await account.createEmailPasswordSession(signupData.email, signupData.password);
+ const user = await account.get();
+ if (user) {
+ localStorage.setItem("isLoggedIn", "true");
+ setIsAuthenticated(true);
+ router.push("/dashboard");
+ }
+ } catch (error) {
+ console.error("Signup error:", error);
+ setErrors({
+ ...errors,
+ general: error.message || "Signup failed. Please try again.",
+ });
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ if (authLoading) {
return (
- {/* Spinner */}
- {/* Loading Text */}
-
+
Loading...
@@ -34,5 +154,231 @@ export default function Home() {
);
}
- return null; // No need to render anything here
+ if (isAuthenticated) {
+ return null;
+ }
+
+ return (
+
+
+
+
+
+ {isLoginForm ? "Sign In" : "Sign Up"}
+
+
+ {isLoginForm
+ ? "Enter your email and password to sign In!"
+ : "Enter your deatils to create an account!"}
+
+
+
+ {errors.general && (
+
+ {errors.general}
+
+ )}
+
+ {isLoginForm ? (
+ // Login Form
+
+ ) : (
+ // Sign Up Form
+
+ )}
+
+
+
+ {isLoginForm ? "Don't have an account?" : "Already have an account?"}
+
+
+
+
+
+
+ {/* Dark mode toggle */}
+
+
+ );
}
\ No newline at end of file
diff --git a/src/app/pages/BarChart/page.js b/src/app/pages/BarChart/page.js
deleted file mode 100644
index 1bfdd85..0000000
--- a/src/app/pages/BarChart/page.js
+++ /dev/null
@@ -1,77 +0,0 @@
-'use client';
-
-import { useEffect, useState } from 'react';
-import Head from 'next/head';
-import dynamic from 'next/dynamic';
-import Preloader from "../../components/partials/preloaders";
-// import Sidebar from '../partials/sidebar';
-import Overlay from "../../components/partials/overlay";
-import Header from "../../components/partials/header";
-import Breadcrumb from "../../components/partials/breadcrumb";
-
-// Dynamically import the chart component with SSR disabled
-const ChartOne = dynamic(
- () => import("../../components/charts/chart-01"),
- { ssr: false }
-);
-
-export default function BarChartPage() {
- const [darkMode, setDarkMode] = useState(false);
- const [loaded, setLoaded] = useState(true);
-
- // Initialize dark mode from localStorage
- useEffect(() => {
- const savedDarkMode = JSON.parse(localStorage.getItem('darkMode'));
- if (savedDarkMode !== null) {
- setDarkMode(savedDarkMode);
- }
- setLoaded(true); // Simulate loading completion
- }, []);
-
- // Save dark mode preference when it changes
- useEffect(() => {
- localStorage.setItem('darkMode', JSON.stringify(darkMode));
- }, [darkMode]);
-
- return (
-
- {/* Preloader */}
- {!loaded &&
}
-
- {/* Sidebar */}
- {/*
*/}
-
- {/* Content Area */}
-
- {/* Small Device Overlay */}
-
-
- {/* Header */}
-
-
-
- {/* Main Content */}
-
-
- {/* Breadcrumb */}
-
-
-
-
-
-
- Bar Chart 1
-
-
-
- {/* Chart One Component */}
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/pages/FormElements/page.js b/src/app/pages/FormElements/page.js
deleted file mode 100644
index abac8c6..0000000
--- a/src/app/pages/FormElements/page.js
+++ /dev/null
@@ -1,893 +0,0 @@
-"use client";
-import { useState } from 'react';
-
-const FormElementPage = () => {
- const [checkboxStates, setCheckboxStates] = useState({
- default: false,
- checked: true,
- disabled: true
- });
-
- const [radioStates, setRadioStates] = useState({
- default: false,
- secondary: true,
- disabled: false
- });
-
- const [toggleStates, setToggleStates] = useState({
- default: false,
- checked: true,
- disabled: false,
- defaultDark: false,
- checkedDark: true,
- disabledDark: false
- });
-
- const [selectedCountry, setSelectedCountry] = useState('US');
- const [phoneNumber, setPhoneNumber] = useState('');
-
- const countryCodes = {
- 'US': '+1',
- 'GB': '+44',
- 'CA': '+1',
- 'AU': '+61'
- };
-
- const handleCountryChange = (e) => {
- const country = e.target.value;
- setSelectedCountry(country);
- setPhoneNumber(countryCodes[country]);
- };
-
- const copyToClipboard = () => {
- const input = document.getElementById('website-input');
- input.select();
- document.execCommand('copy');
- const copyText = document.getElementById('copy-text');
- copyText.textContent = 'Copied!';
- setTimeout(() => {
- copyText.textContent = 'Copy';
- }, 2000);
- };
-
- return (
-
-
-
- {/* Default Inputs */}
-
-
-
- Default Inputs
-
-
-
- {/* Input */}
-
-
-
-
-
- {/* Input with Placeholder */}
-
-
-
-
-
- {/* Select Input */}
-
-
-
-
-
-
-
-
-
-
- {/* Password Input */}
-
-
- {/* Date Picker Input */}
-
-
-
-
-
- {/* Time Select Input */}
-
-
-
-
-
- {/* Input with Payment */}
-
-
-
-
-
-
-
- {/* Select Inputs */}
-
-
-
- Select Inputs
-
-
-
- {/* Select Input */}
-
-
-
-
-
-
-
-
-
-
- {/* Multiple Select Options */}
-
-
-
-
-
-
-
-
-
-
-
-
- {/* Selected options would be rendered here */}
-
-
-
-
-
-
-
- {/* Options would be rendered here */}
-
-
-
-
-
-
-
-
-
-
-
- {/* Textarea input field */}
-
-
-
- Textarea input field
-
-
-
- {/* Description */}
-
-
-
-
-
- {/* Disabled Description */}
-
-
-
-
-
- {/* Error Description */}
-
-
-
-
- Please enter a message in the textarea.
-
-
-
-
-
- {/* Input States */}
-
-
-
- Input States
-
-
- Validation styles for error, success and disabled states on form controls.
-
-
-
- {/* Error State */}
-
-
-
-
- This is an error message.
-
-
-
- {/* Success State */}
-
-
-
-
- This is an success message.
-
-
-
- {/* Disabled State */}
-
-
-
-
-
-
-
-
-
- {/* Input Group */}
-
-
-
- Input Group
-
-
-
- {/* Email with icon */}
-
-
- {/* Phone with country code */}
-
-
-
-
-
-
-
-
setPhoneNumber(e.target.value)}
- type="tel"
- className="dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:ring-brand-500/10 dark:focus:border-brand-800 h-11 w-full rounded-lg border border-gray-300 bg-transparent py-3 pr-4 pl-[84px] text-sm text-gray-800 placeholder:text-gray-400 focus:ring-3 focus:outline-hidden dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30"
- />
-
-
-
- {/* Phone with right country code */}
-
-
-
-
-
-
-
-
setPhoneNumber(e.target.value)}
- type="tel"
- className="dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:ring-brand-500/10 dark:focus:border-brand-800 h-11 w-full rounded-lg border border-gray-300 bg-transparent py-3 pr-[84px] pl-3 text-sm text-gray-800 placeholder:text-gray-400 focus:ring-3 focus:outline-hidden dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30"
- />
-
-
-
- {/* URL with prefix */}
-
-
-
-
- http://
-
-
-
-
-
- {/* Website with copy button */}
-
-
-
-
- {/* File Input */}
-
-
-
- File Input
-
-
-
-
-
-
-
-
-
-
- {/* Checkboxes */}
-
-
-
- Checkboxes
-
-
-
-
- {/* Default Checkbox */}
-
-
-
-
- {/* Checked Checkbox */}
-
-
-
-
- {/* Disabled Checkbox */}
-
-
-
-
-
-
-
- {/* Radio Buttons */}
-
-
-
- Radio Buttons
-
-
-
-
- {/* Default Radio */}
-
-
-
-
- {/* Secondary Radio */}
-
-
-
-
- {/* Disabled Radio */}
-
-
-
-
-
-
-
- {/* Toggle switch input */}
-
-
-
- Toggle switch input
-
-
-
-
- {/* Default Toggle */}
-
-
-
-
- {/* Checked Toggle */}
-
-
-
-
- {/* Disabled Toggle */}
-
-
-
-
-
-
- {/* Default Dark Toggle */}
-
-
-
-
- {/* Checked Dark Toggle */}
-
-
-
-
- {/* Disabled Dark Toggle */}
-
-
-
-
-
-
-
- {/* Dropzone */}
-
-
-
- Dropzone
-
-
-
-
-
-
-
-
- Drop File Here
-
-
- Drag and drop your PNG, JPG, WebP, SVG images here or browse
-
-
-
- Browse File
-
-
-
-
-
-
-
-
- );
-};
-
-export default FormElementPage;
\ No newline at end of file
diff --git a/src/app/pages/LineChart/page.js b/src/app/pages/LineChart/page.js
deleted file mode 100644
index 98b32ad..0000000
--- a/src/app/pages/LineChart/page.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// app/page.js or app/dashboard/page.js (depending on your structure)
-'use client'; // This is needed because we'll use client-side state
-
-import { useEffect, useState } from 'react';
-import dynamic from 'next/dynamic';
-
-// Dynamically import the chart component to avoid SSR issues
-const LineChart = dynamic(() => import("../../components/charts/LineChart"), {
- ssr: false
-});
-
-export default function LineChartPage() {
- const [darkMode, setDarkMode] = useState(false);
- const [isLoaded, setIsLoaded] = useState(false);
-
- useEffect(() => {
- // Load dark mode preference from localStorage
- const savedDarkMode = JSON.parse(localStorage.getItem('darkMode'));
- if (savedDarkMode !== null) {
- setDarkMode(savedDarkMode);
- }
- setIsLoaded(true);
- }, []);
-
- useEffect(() => {
- // Save dark mode preference to localStorage when it changes
- localStorage.setItem('darkMode', JSON.stringify(darkMode));
- }, [darkMode]);
-
- if (!isLoaded) {
- // Preloader while checking dark mode preference
- return (
-
- );
- }
-
- return (
-
- {/* Main Content Area */}
-
- {/* Main Content */}
-
-
- {/* Breadcrumb */}
-
-
- {/* Chart Section */}
-
-
-
-
- Line Chart 1
-
-
-
- {/* Line Chart Component */}
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/app/pages/MultiBooked/page.js b/src/app/pages/MultiBooked/page.js
index d8c4b82..16606b0 100644
--- a/src/app/pages/MultiBooked/page.js
+++ b/src/app/pages/MultiBooked/page.js
@@ -82,7 +82,7 @@ const createEntries = async () => {
}
setBookings(updatedBookings);
- alert(`${validBookings.length} tokens created successfully!`);
+ // alert(`${validBookings.length} tokens created successfully!`);
} catch (error) {
console.error("Creation error:", error);
setError(error.message);
diff --git a/src/app/pages/MultiBooking/page.js b/src/app/pages/MultiBooking/page.js
index 23e3972..fd4d9ad 100644
--- a/src/app/pages/MultiBooking/page.js
+++ b/src/app/pages/MultiBooking/page.js
@@ -58,13 +58,13 @@ export default function MultiBooking() {
{/* Sticky Header */}
-
+
{/* Main Content */}
-
+
{error && (
diff --git a/src/app/pages/ResetPasswordPage/page.js b/src/app/pages/ResetPasswordPage/page.js
index b34d281..a310d65 100644
--- a/src/app/pages/ResetPasswordPage/page.js
+++ b/src/app/pages/ResetPasswordPage/page.js
@@ -17,16 +17,24 @@ export default function ResetPasswordPage() {
const { darkMode, toggleDarkMode } = useTheme();
const [email, setEmail] = useState("");
const [loading, setLoading] = useState(false);
+ const [message, setMessage] = useState({ text: "", type: "" }); // type can be "success" or "error"
const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
+ setMessage({ text: "", type: "" });
try {
await account.createRecovery(email, "http://localhost:3000/reset-password");
- alert("Password reset link sent to your email!");
+ setMessage({
+ text: "Password reset link sent to your email!",
+ type: "success"
+ });
} catch (error) {
console.error("Error:", error);
- alert(`Failed to send reset link: ${error.message}`);
+ setMessage({
+ text: `Failed to send reset link: ${error.message}`,
+ type: "error"
+ });
} finally {
setLoading(false);
}
@@ -53,6 +61,15 @@ export default function ResetPasswordPage() {
Enter your email address linked to your account, and we'll send you a link to reset your password.
+ {message.text && (
+
+ {message.text}
+
+ )}