Skip to content

Commit

Permalink
remove state variable isBedOccupied
Browse files Browse the repository at this point in the history
  • Loading branch information
GokulramGHV committed Jan 7, 2024
1 parent d5fae13 commit 5a7e092
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useFullscreen from "../../Common/hooks/useFullscreen";
import { Fragment, useState } from "react";
import { Fragment } from "react";
import HL7PatientVitalsMonitor from "../VitalsMonitor/HL7PatientVitalsMonitor";
import useFilters from "../../Common/hooks/useFilters";
import Loading from "../Common/Loading";
Expand Down Expand Up @@ -39,11 +39,6 @@ export default function CentralNursingStation({ facilityId }: Props) {
const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
limit: PER_PAGE_LIMIT,
});
const [isBedOccupied, setIsBedOccupied] = useState<boolean>(
qParams.bed_is_occupied === undefined
? true
: qParams.bed_is_occupied === "true"
);
const query = useQuery(routes.listPatientAssetBeds, {
pathParams: { facility_external_id: facilityId },
query: {
Expand Down Expand Up @@ -155,11 +150,14 @@ export default function CentralNursingStation({ facilityId }: Props) {
/>
<CheckBoxFormField
name="bed_is_occupied"
label="Hide Monitors without Patient"
value={isBedOccupied}
label="Hide Monitors without Patients"
value={
qParams.bed_is_occupied === undefined
? true
: qParams.bed_is_occupied === "true"
}
onChange={({ name, value }) => {
updateQuery({ [name]: value });
setIsBedOccupied(value);
}}
labelClassName="text-sm"
errorClassName="hidden"
Expand Down

0 comments on commit 5a7e092

Please sign in to comment.