"use strict";
exports.__esModule = true;
exports.CalendarMonth = exports.cnCalendarMonth = void 0;
var tslib_1 = require("tslib");
require("./CalendarMonth.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var bem_1 = require("../../../utils/bem");
var Typography_1 = require("../../Typography");
var CalendarDay_1 = require("../CalendarDay/CalendarDay");
var Calendar_ell_1 = require("../Calendar\u0421ell/Calendar\u0421ell");
exports.cnCalendarMonth = (0, bem_1.cn)('CalendarMonth');
var CalendarMonth = function (props) {
    var className = props.className, daysOfWeek = props.daysOfWeek, daysOfMonth = props.daysOfMonth, otherProps = (0, tslib_1.__rest)(props, ["className", "daysOfWeek", "daysOfMonth"]);
    return (react_1["default"].createElement("div", (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnCalendarMonth)(null, [className]) }),
        daysOfWeek.map(function (item, index) { return (react_1["default"].createElement(Calendar_ell_1.CalendarCell, { key: (0, exports.cnCalendarMonth)('DayOfWeek', { index: index, item: item }), className: "is-day" },
            react_1["default"].createElement(Typography_1.Typography.Text, { as: "span", size: "xs", weight: "bold", transform: "uppercase" }, item))); }),
        daysOfMonth.map(function (_a, index) {
            var range = _a.range, dayProps = (0, tslib_1.__rest)(_a, ["range"]);
            return (react_1["default"].createElement(Calendar_ell_1.CalendarCell, { key: (0, exports.cnCalendarMonth)('DayOfMonth', {
                    index: index,
                    number: dayProps.number
                }), range: range },
                react_1["default"].createElement(CalendarDay_1.CalendarDay, (0, tslib_1.__assign)({}, dayProps))));
        })));
};
exports.CalendarMonth = CalendarMonth;
