diff --git a/src/Components/Facility/LocationManagement.tsx b/src/Components/Facility/LocationManagement.tsx
index 83bf335aff2..80dcef87dfc 100644
--- a/src/Components/Facility/LocationManagement.tsx
+++ b/src/Components/Facility/LocationManagement.tsx
@@ -13,6 +13,7 @@ import ConfirmDialog from "../Common/ConfirmDialog";
import DialogModal from "../Common/Dialog";
import Uptime from "../Common/Uptime";
import useAuthUser from "../../Common/hooks/useAuthUser";
+import useQuery from "../../Utils/request/useQuery";
const Loading = lazy(() => import("../Common/Loading"));
@@ -23,6 +24,7 @@ interface Props {
interface LocationProps extends LocationModel {
facilityId: string;
disabled: boolean;
+ totalBeds?: number;
setShowDeletePopup: (e: { open: boolean; name: string; id: string }) => void;
}
@@ -73,6 +75,20 @@ export default function LocationManagement({ facilityId }: Props) {
setShowDeletePopup({ ...showDeletePopup, open: false });
};
+ function BedsData(facilityId: string, locationId: string) {
+ const { loading, data } = useQuery(routes.listFacilityBeds, {
+ query: {
+ facility: facilityId,
+ location: locationId,
+ },
+ });
+
+ return {
+ loading,
+ totalBeds: data?.results.length || 0,
+ };
+ }
+
return (