diff --git a/public/locale/en.json b/public/locale/en.json index e1e82f28f5f..0e6cf4a82a0 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1563,6 +1563,7 @@ "no_linked_facilities": "No Linked Facilities", "no_location": "No location assigned", "no_location_description": "This device is not currently assigned to any location", + "no_locations": "No locations", "no_locations_available": "No locations available", "no_locations_found": "No locations found", "no_log_update_delta": "No changes since previous log update", diff --git a/src/components/ui/sidebar/facility-nav.tsx b/src/components/ui/sidebar/facility-nav.tsx index e8a8b4a88ce..282fd48f62c 100644 --- a/src/components/ui/sidebar/facility-nav.tsx +++ b/src/components/ui/sidebar/facility-nav.tsx @@ -34,11 +34,6 @@ function generateFacilityLinks( url: `${baseUrl}/patients`, icon: "d-patient", }, - { - name: t("locations"), - url: `${baseUrl}/locations`, - icon: "d-patient", - }, { name: t("encounters"), url: `${baseUrl}/encounters`, diff --git a/src/pages/Facility/locations/LocationList.tsx b/src/pages/Facility/locations/LocationList.tsx index 4e5391b3e6a..e13465682fd 100644 --- a/src/pages/Facility/locations/LocationList.tsx +++ b/src/pages/Facility/locations/LocationList.tsx @@ -610,34 +610,36 @@ export default function LocationList({ facilityId }: { facilityId: string }) { }, [allLocations?.results]); return ( -
+
{/* Left sidebar - Location tree */} -
-
-

{t("locations")}

-
- -
- {isLoadingLocations ? ( -
- -
- ) : ( - topLevelLocations.map((location) => ( - - )) - )} + {topLevelLocations.length > 0 && ( +
+
+

{t("locations")}

- -
+ +
+ {isLoadingLocations ? ( +
+ +
+ ) : ( + topLevelLocations.map((location) => ( + + )) + )} +
+
+
+ )} {/* Main content area */}
@@ -690,16 +692,24 @@ export default function LocationList({ facilityId }: { facilityId: string }) {
) : ( <> -
- {topLevelLocations.map((location) => ( - handleLocationSelect(location)} - facilityId={facilityId} - /> - ))} -
+ {topLevelLocations.length === 0 ? ( + + + {t("no_locations")} + + + ) : ( +
+ {topLevelLocations.map((location) => ( + handleLocationSelect(location)} + facilityId={facilityId} + /> + ))} +
+ )} )}