diff --git a/src/CAREUI/misc/PaginatedList.tsx b/src/CAREUI/misc/PaginatedList.tsx index 7bbc4330991..28ee17650ad 100644 --- a/src/CAREUI/misc/PaginatedList.tsx +++ b/src/CAREUI/misc/PaginatedList.tsx @@ -143,11 +143,16 @@ PaginatedList.Items = Items; interface PaginatorProps { className?: string; + hideIfSinglePage?: boolean; } -const Paginator = ({ className }: PaginatorProps) => { +const Paginator = ({ className, hideIfSinglePage }: PaginatorProps) => { const { data, perPage, currentPage, setPage } = useContextualized(); + if (hideIfSinglePage && (data?.count ?? 0) <= perPage) { + return null; + } + return ( - - - - Add New Location - - + + + Add New Location + } > +
+ + + Add New Location + +
No locations available @@ -44,12 +52,12 @@ export default function LocationManagement({ facilityId }: Props) { - className="m-8 flex grow flex-col gap-3"> + className="my-8 flex grow flex-col gap-3 lg:mx-8"> {(item) => }
- +
)}