dnazarenkoo 10a3a6d3e5
feat: add the traces view for the traces explorer (#2966)
* feat: add dynamic table based on query

* feat: add the list view for the traces explorer

* feat: add the list view for the traces explorer

* feat: add the list view for the traces explorer

* feat: add the table view for the traces explorer

* feat: add the table view for the traces explorer

* feat: add the trace view for the traces explorer

* feat: update the traces view tab for the traces explorer page

* feat: update the traces view

---------

Co-authored-by: Yevhen Shevchenko <y.shevchenko@seedium.io>
Co-authored-by: Nazarenko19 <danil.nazarenko2000@gmail.com>
Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
2023-07-04 10:54:34 +05:30

21 lines
492 B
TypeScript

import { DEFAULT_PER_PAGE_OPTIONS } from './config';
import { Pagination } from './types';
export const checkIsValidPaginationData = (
{ limit, offset }: Pagination,
perPageOptions: number[],
): boolean =>
Boolean(
Number.isInteger(limit) &&
limit > 0 &&
offset >= 0 &&
perPageOptions.find((option) => option === limit),
);
export const getDefaultPaginationConfig = (
perPageOptions = DEFAULT_PER_PAGE_OPTIONS,
): Pagination => ({
offset: 0,
limit: perPageOptions[0],
});