import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons';
import { Box, Button, IconButton } from '@chakra-ui/react';
export const TablePagination = props => {
    const { pageNumber, currentPage, onChange } = props;
    const pageEles = Array(pageNumber)
        .fill(1)
        .map((_, i) => {
        const onClick = () => onChange(i);
        return (_jsx(Button, Object.assign({ margin: "1", disabled: currentPage === i, onClick: onClick }, { children: i + 1 }), i));
    });
    return (_jsxs(Box, Object.assign({ margin: "4" }, { children: [_jsx(IconButton, { "aria-label": "prev", icon: _jsx(ChevronLeftIcon, {}, void 0), disabled: currentPage === 0, onClick: () => onChange(Math.max(0, currentPage - 1)) }, void 0), pageEles, _jsx(IconButton, { "aria-label": "next", icon: _jsx(ChevronRightIcon, {}, void 0), disabled: currentPage === pageNumber - 1, onClick: () => onChange(Math.min(pageNumber - 1, currentPage + 1)) }, void 0)] }), void 0));
};
//# sourceMappingURL=Pagination.js.map