import React from 'react'; const paginationUpdateTypes = ['prev', 'next', 'click']; export type PaginationUpdateType = typeof paginationUpdateTypes[number]; export type PaginationConfig = { currentPage: number; isFirst?: boolean; isLast?: boolean; update?: (type: PaginationUpdateType) => void; resolveUrl: (page: number) => string | undefined; }; const defaultContext = { currentPage: 1, resolveUrl: () => { return undefined; }, }; export const PaginationContext = React.createContext(defaultContext); export function usePaginationContext() { return React.useContext(PaginationContext); }