import React, { useCallback, useRef } from "react"; import ReactPaginate from "react-paginate"; import { usePagination } from "react-use-pagination"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useContentWidth } from "../../libs/width"; import styles from "./styles.module.css"; export default function Paginate({ totalPages, setPage, currentPage, }: ReturnType): JSX.Element { const ref = useRef(); const maxWidth = useContentWidth(ref.current?.parentElement ?? undefined); const onPageChange = useCallback( (selectedItem: { selected: number }) => { setPage(selectedItem.selected); }, [setPage] ); // FIXME: responsive width return ( ); }