Only show pagination controls when necessary
Signed-off-by: Larry Knott <larry.knott@autodesk.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
Only show pagination controls when necessary
|
||||
@@ -94,14 +94,17 @@ export const DocsTable = (props: DocsTableProps) => {
|
||||
actionFactories.createCopyDocsUrlAction(copyToClipboard),
|
||||
];
|
||||
|
||||
const pageSize = 20;
|
||||
const paging = documents && documents.length > pageSize;
|
||||
|
||||
return (
|
||||
<>
|
||||
{loading || (documents && documents.length > 0) ? (
|
||||
<Table<DocsTableRow>
|
||||
isLoading={loading}
|
||||
options={{
|
||||
paging: true,
|
||||
pageSize: 20,
|
||||
paging,
|
||||
pageSize,
|
||||
search: true,
|
||||
actionsColumnIndex: -1,
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user