catalog: refactor pagination methods
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -19,14 +19,19 @@ import Box from '@material-ui/core/Box';
|
||||
|
||||
import { BaseTable, TableProps, tableStyles } from '@backstage/core-components';
|
||||
import { CatalogTableRow } from './types';
|
||||
import { useEntityList } from '@backstage/plugin-catalog-react';
|
||||
|
||||
export function PaginatedCatalogTable(props: TableProps<CatalogTableRow>) {
|
||||
const { columns, data } = props;
|
||||
type PaginatedCatalogTableProps = {
|
||||
prev?(): void;
|
||||
next?(): void;
|
||||
} & TableProps<CatalogTableRow>;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function PaginatedCatalogTable(props: PaginatedCatalogTableProps) {
|
||||
const { columns, data, next, prev } = props;
|
||||
const tableClasses = tableStyles();
|
||||
|
||||
const { next, prev } = useEntityList();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box className={tableClasses.root}>
|
||||
|
||||
Reference in New Issue
Block a user