From a84e897a326a479b37881ddba9a59cb1e5f65a8b Mon Sep 17 00:00:00 2001 From: Ashesh3 <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:45:10 +0530 Subject: [PATCH] Refactor BedManagement component --- src/Components/Facility/BedManagement.tsx | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Components/Facility/BedManagement.tsx b/src/Components/Facility/BedManagement.tsx index 68e9fade43d..d8799f1fbc5 100644 --- a/src/Components/Facility/BedManagement.tsx +++ b/src/Components/Facility/BedManagement.tsx @@ -182,24 +182,22 @@ export const BedManagement = (props: BedManagementProps) => { )); } else if (data?.results.length === 0) { BedList = ( -

+

No beds available in this location

); } - if (data?.results.length) { - bed = ( - <> -
{BedList}
- {data.count && ( -
- -
- )} - - ); - } + bed = ( + <> +
{BedList}
+ {Boolean(data?.count && data.count > 0) && ( +
+ +
+ )} + + ); if (loading) { return ;