"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const useLogic = (props) => {
    /**
     * Обработчик смены страницы
     */
    const onChange = (_event, pageNumber) => {
        props.onChangePage(pageNumber);
        const element = props.paginationRef.current?.childNodes[pageNumber - 1];
        if (element) {
            element.scrollIntoView({ behavior: 'auto', block: 'start' });
        }
    };
    return {
        count: props.count,
        page: props.page,
        onChange,
    };
};
exports.useLogic = useLogic;
