Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ export default {
component: UsersTable,
} satisfies Meta<typeof UsersTable>;

const Template: StoryFn<typeof UsersTable> = (args) => <UsersTable {...args} />;
const mockedPagination = {
current: 0,
setCurrent: () => undefined,
itemsPerPage: 25 as const,
setItemsPerPage: () => undefined,
itemsPerPageLabel: () => 'Items per page:',
showingResultsLabel: () => 'Showing results 1 - 5 of 5',
};

const Template: StoryFn<typeof UsersTable> = (args) => <UsersTable {...args} paginationData={mockedPagination} />;

export const Default = Template.bind({});
Default.args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const UsersTable = ({
const isLaptop = !breakpoints.includes('xxl');

const canManageVoipExtension = useVoipExtensionPermission();
const { current, itemsPerPage, setCurrent, setItemsPerPage, ...paginationProps } = paginationData;

const isKeyboardEvent = (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>): event is KeyboardEvent<HTMLElement> => {
return (event as KeyboardEvent<HTMLElement>).key !== undefined;
Expand Down Expand Up @@ -204,10 +205,12 @@ const UsersTable = ({
</GenericTable>
<Pagination
divider
current={current}
itemsPerPage={itemsPerPage}
count={total}
onSetItemsPerPage={paginationData?.setItemsPerPage}
onSetCurrent={paginationData?.setCurrent}
{...paginationData}
onSetItemsPerPage={setItemsPerPage}
onSetCurrent={setCurrent}
{...paginationProps}
/>
</>
)}
Expand Down
Loading