diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx
index 26bed83635b..0eae504399c 100644
--- a/src/Components/Facility/CentralNursingStation.tsx
+++ b/src/Components/Facility/CentralNursingStation.tsx
@@ -168,11 +168,15 @@ export default function CentralNursingStation({ facilityId }: Props) {
Filter by Location
-
+
updateQuery({ location })}
+ setSelected={(location) => {
+ location
+ ? updateQuery({ location })
+ : removeFilter("location");
+ }}
selected={qParams.location}
showAll={false}
multiple={false}
@@ -180,16 +184,6 @@ export default function CentralNursingStation({ facilityId }: Props) {
errors=""
errorClassName="hidden"
/>
- {qParams.location && (
- removeFilter("location")}
- >
- Clear
-
- )}
{
: "button-primary-border bg-primary-100"
}`}
>
-
+
Live Patients / Total beds
{" "}
void
-) => {
- const orderData = localStorage.getItem("live-feed-order");
- if (orderData) {
- const order = JSON.parse(orderData);
- const orderValue = order.find((item: any) => item.facility === facilityId);
- setOrdering(orderValue.order);
- }
-};
-
-const setOrderingList = async (facilityId: string, order: string) => {
- const orderData = localStorage.getItem("live-feed-order") || "[]";
- const orderList = JSON.parse(orderData);
- const index = orderList.findIndex(
- (item: any) => item.facility === facilityId
- );
- if (index !== -1) {
- orderList[index].order = order;
- } else {
- orderList.push({ facility: facilityId, order });
- }
- localStorage.setItem("live-feed-order", JSON.stringify(orderList));
-};
-
export default function LiveFeedScreen({ facilityId }: Props) {
- const { t } = useTranslation();
const dispatch = useDispatch();
const [isFullscreen, setFullscreen] = useFullscreen();
const sidebar = useContext(SidebarShrinkContext);
@@ -73,7 +36,6 @@ export default function LiveFeedScreen({ facilityId }: Props) {
const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
limit: PER_PAGE_LIMIT,
});
- const [ordering, setOrdering] = useState("bed__name");
const [refresh_presets_hash, setRefreshPresetsHash] = useState(
Number(new Date())
@@ -88,10 +50,6 @@ export default function LiveFeedScreen({ facilityId }: Props) {
};
}, []);
- useEffect(() => {
- getOrderingList(facilityId, setOrdering);
- }, [facilityId]);
-
useEffect(() => {
async function fetchFacilityOrObject() {
if (facility) return facility;
@@ -112,7 +70,6 @@ export default function LiveFeedScreen({ facilityId }: Props) {
asset_class: "ONVIF",
facility: facilityId || "",
location: qParams.location,
- ordering: qParams.ordering || ordering,
bed_is_occupied: qParams.bed_is_occupied,
};
@@ -180,11 +137,15 @@ export default function LiveFeedScreen({ facilityId }: Props) {
Filter by Location
-
+
updateQuery({ location })}
+ setSelected={(location) => {
+ location
+ ? updateQuery({ location })
+ : removeFilter("location");
+ }}
selected={qParams.location}
showAll={false}
multiple={false}
@@ -192,42 +153,8 @@ export default function LiveFeedScreen({ facilityId }: Props) {
errors=""
errorClassName="hidden"
/>
- {qParams.location && (
- removeFilter("location")}
- >
- Clear
-
- )}
- {
- updateQuery({ ordering: value });
- setOrderingList(facilityId, value);
- }}
- options={SORT_OPTIONS}
- optionLabel={({ value }) => t("SortOptions." + value)}
- optionIcon={({ isAscending }) => (
-
- )}
- optionValue={({ value }) => value}
- labelClassName="text-sm"
- errorClassName="hidden"
- />