Skip to content

Commit

Permalink
Introduce useDashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ir4y committed Feb 29, 2024
1 parent f92423c commit 7a980a5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/containers/PatientDetails/PatientOverviewDynamic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@ export interface PatientOverviewProps {
reload: () => void;
}

export function PatientOverview(props: PatientOverviewProps) {
function useDashboard() {
const { patientDashboard } = useContext(PatientDashboardContext);
// TODO select dashboard based on the role
return patientDashboard.default;
}

export function PatientOverview(props: PatientOverviewProps) {
const patientDashboard = useDashboard();

return (
<div className={s.container}>
<Dashboards widgets={patientDashboard.default.top} {...props} />
<Dashboards widgets={patientDashboard.top} {...props} />
<div className={s.cards}>
<div className={s.column}>
<Dashboards widgets={patientDashboard.default.left} {...props} />
<Dashboards widgets={patientDashboard.left} {...props} />
</div>
<div className={s.column}>
<Dashboards widgets={patientDashboard.default.right} {...props} />
<Dashboards widgets={patientDashboard.right} {...props} />
</div>
</div>
<Dashboards widgets={patientDashboard.default.bottom} {...props} />
<Dashboards widgets={patientDashboard.bottom} {...props} />
</div>
);
}

0 comments on commit 7a980a5

Please sign in to comment.