import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { useContext, useMemo } from 'react';
import PanelContext from '../../context/PanelContext';
import PickerContext from '../../context/PickerContext';
import PanelCell from '../../components/PanelCell';
import getPanelCellsData from '../../utils/getPanelCellsData';
import { dateConfig } from '../../utils/dateUtils';
import { setQuarter } from 'date-fns';
var COL_COUNT = 2;
var ROW_COUNT = 2;
var QuarterPickerBody = function (_a) {
    var defaultPanelDate = _a.defaultPanelDate, onSelected = _a.onSelected, selected = _a.selected, disabledPanelDate = _a.disabledPanelDate, _b = _a.row, row = _b === void 0 ? ROW_COUNT : _b, _c = _a.col, col = _c === void 0 ? COL_COUNT : _c;
    var i18n = useContext(PickerContext).i18n;
    var onHover = useContext(PanelContext).onHover;
    var cells = useMemo(function () {
        return getPanelCellsData({
            selected: selected,
            disabledPanelDate: disabledPanelDate,
            defaultPanelDate: setQuarter(defaultPanelDate, 1),
            texts: i18n.panel.quarterNames,
            row: row,
            col: col,
            dateConfig: dateConfig.quarter,
        });
    }, [selected, row, col, defaultPanelDate, i18n, disabledPanelDate]);
    return (_jsx("div", __assign({ className: "zent-datepicker-quarter-panel-body", "data-zv": 'v10.0.11' }, { children: _jsx(PanelCell, { col: col, cells: cells, onSelected: onSelected, onHover: onHover }, void 0) }), void 0));
};
export default QuarterPickerBody;
