Skip to content

Commit aa76d6e

Browse files
committed
[#99] ✅ add Pagination stories
1 parent 3800646 commit aa76d6e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Meta, StoryObj } from '@storybook/react'
2+
3+
import { Pagination } from '@/components/shared/pagination'
4+
5+
import { usePagination } from '@/hooks/usePagination'
6+
7+
export default {
8+
title: 'Shared/Pagination/Pagination',
9+
component: Pagination,
10+
argTypes: {
11+
currentPage: { control: { type: 'number', min: 1 }, defaultValue: 1 },
12+
totalPages: { control: { type: 'number', min: 1 }, defaultValue: 5 },
13+
hasNextPage: { control: 'boolean', defaultValue: true },
14+
hasPreviousPage: { control: 'boolean', defaultValue: false },
15+
},
16+
} as Meta
17+
18+
export const Default: StoryObj = {
19+
args: {
20+
currentPage: 1,
21+
pageButtons: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
22+
totalPages: 5,
23+
hasNextPageGroup: true,
24+
hasPreviousPageGroup: true,
25+
goToPage: (page: number) => alert(`Go to page: ${page}`),
26+
goToNextPageGroup: () => alert('Next page'),
27+
goToPreviousPageGroup: () => alert('Previous page'),
28+
},
29+
}

0 commit comments

Comments
 (0)