implemented identity, updated session, added 'workings' list
added paginated querying, added 'common'
This commit is contained in:
parent
027deba422
commit
6ada519e06
36 changed files with 1422 additions and 279 deletions
44
app/client/components/Pagination.tsx
Normal file
44
app/client/components/Pagination.tsx
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { ButtonGroup, Pagination as ChakraPagination, IconButton } from '@chakra-ui/react';
|
||||
import { LuChevronLeft, LuChevronRight } from 'react-icons/lu';
|
||||
|
||||
export function Pagination({
|
||||
total,
|
||||
page,
|
||||
setPage,
|
||||
pageSize = 5
|
||||
}: {
|
||||
total: number;
|
||||
page: number;
|
||||
setPage: (value: number) => void;
|
||||
pageSize?: number;
|
||||
}) {
|
||||
return (
|
||||
<ChakraPagination.Root
|
||||
count={total}
|
||||
page={page}
|
||||
pageSize={pageSize}
|
||||
onPageChange={e => setPage(e.page)}
|
||||
defaultPage={1}
|
||||
>
|
||||
<ButtonGroup variant="ghost" size="sm">
|
||||
<ChakraPagination.PrevTrigger asChild>
|
||||
<IconButton>
|
||||
<LuChevronLeft />
|
||||
</IconButton>
|
||||
</ChakraPagination.PrevTrigger>
|
||||
|
||||
<ChakraPagination.Items
|
||||
render={page => (
|
||||
<IconButton variant={{ base: 'ghost', _selected: 'solid' }}>{page.value}</IconButton>
|
||||
)}
|
||||
/>
|
||||
|
||||
<ChakraPagination.NextTrigger asChild>
|
||||
<IconButton>
|
||||
<LuChevronRight />
|
||||
</IconButton>
|
||||
</ChakraPagination.NextTrigger>
|
||||
</ButtonGroup>
|
||||
</ChakraPagination.Root>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue