"use strict";
exports.__esModule = true;
exports.CalendarMonthToggler = exports.cnCalendarMonthToggler = void 0;
var tslib_1 = require("tslib");
require("./CalendarMonthToggler.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var IconChevronArrowRight_1 = require("../../../icons/IconChevronArrowRight/IconChevronArrowRight");
var bem_1 = require("../../../utils/bem");
var Button_1 = require("../../Button/Button");
var CalendarMonthLabel_1 = require("../CalendarMonthLabel/CalendarMonthLabel");
exports.cnCalendarMonthToggler = (0, bem_1.cn)('CalendarMonthToggler');
var CalendarMonthToggler = function (props) {
    var label = props.label, className = props.className, prevOnClick = props.prevOnClick, nextOnClick = props.nextOnClick, otherProps = (0, tslib_1.__rest)(props, ["label", "className", "prevOnClick", "nextOnClick"]);
    return (react_1["default"].createElement("div", (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnCalendarMonthToggler)({
            withPrevButton: Boolean(prevOnClick),
            withNextButton: Boolean(nextOnClick)
        }, [className]) }),
        prevOnClick && (react_1["default"].createElement(Button_1.Button, { className: (0, exports.cnCalendarMonthToggler)('Button', { direction: 'prev' }), onClick: prevOnClick, iconLeft: IconChevronArrowRight_1.IconChevronArrowRight, size: "s", view: "ghost", iconSize: "s" })),
        label && react_1["default"].createElement(CalendarMonthLabel_1.CalendarMonthLabel, { className: (0, exports.cnCalendarMonthToggler)('Label'), label: label }),
        nextOnClick && (react_1["default"].createElement(Button_1.Button, { className: (0, exports.cnCalendarMonthToggler)('Button', { direction: 'next' }), onClick: nextOnClick, iconLeft: IconChevronArrowRight_1.IconChevronArrowRight, size: "s", view: "ghost", iconSize: "s" }))));
};
exports.CalendarMonthToggler = CalendarMonthToggler;
