Skip to content

Commit

Permalink
fix: remove pagination if no results found
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Oct 28, 2024
1 parent 849d24a commit 353adc4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/library-authoring/component-picker/SelectLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ const SelectLibrary = ({ selectedLibrary, setSelectedLibrary }: SelectLibraryPro
))}
</Form.RadioSet>
</div>
<Pagination
paginationLabel={intl.formatMessage(messages.selectLibraryPaginationLabel)}
pageCount={data!.numPages}
currentPage={data!.currentPage}
onPageSelect={(page: number) => setCurrentPage(page)}
variant="secondary"
className="align-self-center"
/>
{data.results.length !== 0 && (
<Pagination
paginationLabel={intl.formatMessage(messages.selectLibraryPaginationLabel)}
pageCount={data!.numPages}
currentPage={data!.currentPage}
onPageSelect={(page: number) => setCurrentPage(page)}
variant="secondary"
className="align-self-center"
/>
)}
</Stack>
);
};
Expand Down

0 comments on commit 353adc4

Please sign in to comment.