"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pagination = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const PaginationItem_1 = require("./PaginationItem");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const Pagination = (props) => {
    const { onItemClick, items, restProps } = (0, useLogic_1.useLogic)(props);
    return ((0, jsx_runtime_1.jsx)("nav", { ...restProps, children: (0, jsx_runtime_1.jsx)(styles_1.PaginationList, { children: items.map(({ page: pageNumber, type, selected, disabled, onClick }, index) => {
                return (
                // biome-ignore lint/suspicious/noArrayIndexKey: key=index необходим для корректной работы компонента
                (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(PaginationItem_1.PaginationItem, { pageNumber: pageNumber, type: type, selected: selected, disabled: disabled, onClick: onClick, onItemClick: onItemClick, restPropsDisabled: restProps.disabled }) }, index));
            }) }) }));
};
exports.Pagination = Pagination;
