implemented identity, updated session, added 'workings' list

added paginated querying, added 'common'
This commit is contained in:
lnn0q 2025-05-17 00:29:55 +03:00
parent 027deba422
commit 6ada519e06
36 changed files with 1422 additions and 279 deletions

View 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>
);
}