import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__ from "@chakra-ui/icons";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_usePagination_mjs__ from "../../hooks/usePagination.mjs";
const Pagination = ({ currentPage, totalCount, pageSize = 10, siblingCount = 1, onPageChange })=>{
    const { pages, totalPageCount } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_usePagination_mjs__.usePagination)({
        totalCount,
        pageSize,
        siblingCount,
        currentPage
    });
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.HStack, {
        spacing: 2
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.IconButton, {
        variant: "ghost",
        onClick: ()=>onPageChange(Math.max(1, currentPage - 1)),
        isDisabled: 1 === currentPage,
        icon: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__.ChevronLeftIcon, null),
        "aria-label": "Previous Page"
    }), pages.map((page, idx)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Button, {
            variant: currentPage === page ? 'outline' : 'ghost',
            key: page ?? `${idx}-dots`,
            isDisabled: null === page,
            onClick: ()=>null !== page && onPageChange(page)
        }, page ?? '...')), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.IconButton, {
        variant: "ghost",
        onClick: ()=>onPageChange(Math.min(currentPage + 1, totalPageCount)),
        isDisabled: currentPage === totalPageCount,
        icon: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__.ChevronRightIcon, null),
        "aria-label": "Next Page"
    }));
};
export { Pagination };
