forked from ohcnetwork/care_fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issues/6503/displayCNSon4k
- Loading branch information
Showing
11 changed files
with
573 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 29 additions & 5 deletions
34
src/components/Facility/ConsultationDetails/ConsultationVentilatorTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,44 @@ | ||
import Loading from "@/components/Common/Loading"; | ||
import PageTitle from "@/components/Common/PageTitle"; | ||
import { ConsultationTabProps } from "@/components/Facility/ConsultationDetails/index"; | ||
import { VentilatorPlot } from "@/components/Facility/Consultations/VentilatorPlot"; | ||
import VentilatorTable from "@/components/Facility/Consultations/VentilatorTable"; | ||
|
||
import useFilters from "@/hooks/useFilters"; | ||
|
||
import routes from "@/Utils/request/api"; | ||
import useQuery from "@/Utils/request/useQuery"; | ||
|
||
export const ConsultationVentilatorTab = (props: ConsultationTabProps) => { | ||
const { consultationId } = props; | ||
const { qParams, Pagination, resultsPerPage } = useFilters({ limit: 36 }); | ||
|
||
const { loading: isLoading, data } = useQuery(routes.getDailyReports, { | ||
pathParams: { consultationId }, | ||
query: { | ||
limit: resultsPerPage, | ||
offset: (qParams.page ? qParams.page - 1 : 0) * resultsPerPage, | ||
}, | ||
}); | ||
|
||
if (isLoading) { | ||
return <Loading />; | ||
} | ||
|
||
return ( | ||
<div> | ||
<PageTitle | ||
title="Respiratory Support" | ||
hideBack={true} | ||
breadcrumbs={false} | ||
/> | ||
<VentilatorPlot | ||
facilityId={props.facilityId} | ||
patientId={props.patientId} | ||
consultationId={props.consultationId} | ||
/> | ||
<VentilatorTable dailyRoundsList={data?.results} /> | ||
<VentilatorPlot dailyRoundsList={data?.results} /> | ||
{Boolean(data?.count && data.count > 0) && ( | ||
<div className="mt-4 flex w-full justify-center"> | ||
<Pagination totalCount={data?.count ?? 0} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.