diff --git a/src/app/(panels)/suite/doctor/patients/page.jsx b/src/app/(panels)/suite/doctor/patients/page.jsx index 161aae5..202f8fa 100644 --- a/src/app/(panels)/suite/doctor/patients/page.jsx +++ b/src/app/(panels)/suite/doctor/patients/page.jsx @@ -12,7 +12,7 @@ import { CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { ChevronDown } from "lucide-react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; -import {PersonForm} from "./PatientForm"; +import { PersonForm } from "./PatientForm"; import { Card } from "@/components/ui/card"; import { faker } from "@faker-js/faker"; @@ -22,17 +22,17 @@ export default function PatientsDOC() { const router = useRouter(); const { user } = useUser(); - const [userData, setUserData] = useState(null); - const [patients, setPatients] = useState([]); + const [userData, setUserData] = useState(null); + const [patients, setPatients] = useState([]); useEffect(() => { if (user) { - axios.get(`/api/user?userId=${user.id}`).then(response => { - setUserData(response.data); - if (response.data.role === 'caregiver') { - axios.get('/api/patients').then(res => setPatients(res.data)); - } - }); + axios.get(`/api/user?userId=${user.id}`).then(response => { + setUserData(response.data); + if (response.data.role === 'caregiver') { + axios.get('/api/patients').then(res => setPatients(res.data)); + } + }); } }, [user]); @@ -71,37 +71,33 @@ export default function PatientsDOC() { return (

Patients

-
- - - {userData && userData.role === 'caregiver' && ( -
-
- {finalPatients.map(patient => ( - -
-
-

{patient.name}

-

Age: {patient.age}

-

Last Checkup: {new Date(patient.lastCheckup).toLocaleDateString()}

-
- - - -
- - - -
- ))} -
-
- )} -
-
+
+ {userData && userData.role === 'caregiver' && ( +
+
+ {finalPatients.map(patient => ( + +
+
+

{patient.name}

+

Age: {patient.age}

+

Last Checkup: {new Date(patient.lastCheckup).toLocaleDateString()}

+
+ + + +
+ + + +
+ ))} +
+
+ )}
)