/* * Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. */ import React, { useMemo } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft, faAnglesLeft, faAngleRight, faAnglesRight, } from "@fortawesome/free-solid-svg-icons"; const RichTablePagination = ({ table, tablePageSize, allRows }) => { const { pagination } = table.getState(); const prevPagBtnDisabled = !table.getCanPreviousPage(); const nextPagBtnDisabled = !table.getCanNextPage(); const pageSizes = useMemo(() => { return [tablePageSize ?? 5, 10, 25].filter( (value, index, self) => self.indexOf(value) === index ); }, [tablePageSize]); const renderPaginationButton = (icon, ariaLabel, onClick, disabled) => (