mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
chore: tidy code
This commit is contained in:
@ -20,9 +20,6 @@ export function DataTablePagination<TData>({
|
|||||||
table,
|
table,
|
||||||
additionalInformation = 'VisibleCount',
|
additionalInformation = 'VisibleCount',
|
||||||
}: DataTablePaginationProps<TData>) {
|
}: DataTablePaginationProps<TData>) {
|
||||||
const pageCount = table.getPageCount();
|
|
||||||
const isEmptyTable = pageCount === 0;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-4 px-2">
|
<div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-4 px-2">
|
||||||
<div className="text-muted-foreground flex-1 text-sm">
|
<div className="text-muted-foreground flex-1 text-sm">
|
||||||
@ -68,9 +65,7 @@ export function DataTablePagination<TData>({
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-x-6 gap-y-4 lg:gap-x-8">
|
<div className="flex flex-wrap items-center gap-x-6 gap-y-4 lg:gap-x-8">
|
||||||
<div className="flex items-center text-sm font-medium md:justify-center">
|
<div className="flex items-center text-sm font-medium md:justify-center">
|
||||||
{isEmptyTable
|
Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount() || 1}
|
||||||
? 'Page 1 of 1'
|
|
||||||
: `Page ${table.getState().pagination.pageIndex + 1} of ${pageCount}`}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-x-2">
|
<div className="flex items-center gap-x-2">
|
||||||
@ -104,7 +99,7 @@ export function DataTablePagination<TData>({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="hidden h-8 w-8 p-0 lg:flex"
|
className="hidden h-8 w-8 p-0 lg:flex"
|
||||||
onClick={() => table.setPageIndex(pageCount - 1)}
|
onClick={() => table.setPageIndex(table.getPageCount() - 1)}
|
||||||
disabled={!table.getCanNextPage()}
|
disabled={!table.getCanNextPage()}
|
||||||
>
|
>
|
||||||
<span className="sr-only">Go to last page</span>
|
<span className="sr-only">Go to last page</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user