diff --git a/src/app/(panels)/suite/doctor/account/page.jsx b/src/app/(panels)/suite/doctor/account/page.jsx
index 01cb049..ff54128 100644
--- a/src/app/(panels)/suite/doctor/account/page.jsx
+++ b/src/app/(panels)/suite/doctor/account/page.jsx
@@ -7,17 +7,9 @@ import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Card, CardHeader, CardContent } from '@/components/ui/card';
-import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"
-import { ChevronDown } from "lucide-react"
-
-import { PersonForm } from './PatientForm';
-
-import { useRouter } from 'next/navigation';
-
const AccountPage = () => {
const { user } = useUser();
const [userData, setUserData] = useState(null);
- const [patients, setPatients] = useState([]);
useEffect(() => {
if (user) {
@@ -72,33 +64,6 @@ const AccountPage = () => {
-
- {userData.role === 'caregiver' && (
-
Dashboard
-
)
diff --git a/src/app/(panels)/suite/doctor/account/PatientForm.tsx b/src/app/(panels)/suite/doctor/patient/PatientForm.tsx
similarity index 100%
rename from src/app/(panels)/suite/doctor/account/PatientForm.tsx
rename to src/app/(panels)/suite/doctor/patient/PatientForm.tsx
diff --git a/src/app/(panels)/suite/doctor/patient/page.jsx b/src/app/(panels)/suite/doctor/patient/page.jsx
new file mode 100644
index 0000000..1ff4180
--- /dev/null
+++ b/src/app/(panels)/suite/doctor/patient/page.jsx
@@ -0,0 +1,69 @@
+
+"use client";
+
+import { useEffect, useState } from "react";
+
+import { useRouter } from "next/navigation";
+
+import axios from "axios";
+import { useUser } from "@clerk/nextjs";
+import { CardContent } from "@/components/ui/card";
+
+export default function Dashboard() {
+
+ const router = useRouter();
+ const { user } = useUser();
+ const [userData, setUserData] = useState(null);
+ const [patients, setPatients] = useState([]);
+
+ useEffect(() => {
+ if (user) {
+ axios.get(`/api/user?userId=${user.id}`).then(response => {
+ setUserData(response.data);
+ });
+ }
+ }, [user]);
+
+ if (userData) {
+ if (userData.role != "caregiver") {
+ router.push("/suite/patient/dashboard");
+ }
+ }
+
+ return (
+
+
Patients
+
+
+
+ {userData.role === 'caregiver' && (
+
+
+ {patients.map(patient => (
+
+
+
+
{patient.name}
+
{patient.role}
+
+
+
+
+
+
+
+
+
+ ))}
+
+
+ )}
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index ac07830..161b9f9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -22,6 +22,6 @@
"@/*": ["./src/*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/api/connectDB.js", "src/lib/utils.js", "src/app/(web)/account/page.jsx", "src/app/(panels)/suite/patient/account/page.jsx", "src/app/(panels)/suite/patient/dashboard/MedicationTable.jsx", "src/app/(panels)/suite/patient/dashboard/page.jsx", "src/app/api/transcribe/route.js", "src/components/ui/calendar.jsx", "src/app/(web)/page.jsx", "src/app/(web)/transcribe/page.jsx", "src/app/(web)/login/page.jsx", "src/app/(panels)/suite/layout.jsx", "src/app/(panels)/suite/doctor/dashboard/page.jsx", "src/app/(panels)/suite/patient/chat/page.jsx"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/api/connectDB.js", "src/lib/utils.js", "src/app/(web)/account/page.jsx", "src/app/(panels)/suite/patient/account/page.jsx", "src/app/(panels)/suite/patient/dashboard/MedicationTable.jsx", "src/app/(panels)/suite/patient/dashboard/page.jsx", "src/app/api/transcribe/route.js", "src/components/ui/calendar.jsx", "src/app/(web)/page.jsx", "src/app/(web)/transcribe/page.jsx", "src/app/(web)/login/page.jsx", "src/app/(panels)/suite/layout.jsx", "src/app/(panels)/suite/doctor/dashboard/page.jsx", "src/app/(panels)/suite/patient/chat/page.jsx", "src/app/(panels)/suite/doctor/dashboard/AppList.jsx", "src/app/(panels)/suite/doctor/patient/page.jsx"],
"exclude": ["node_modules"]
}