'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var Header = require('../Header.cjs');
var PanelContext = require('../../PanelContext.cjs');
var dateUtil = require('../../utils/dateUtil.cjs');
var useMergeProps = require('../../hooks/useMergeProps.cjs');

function MonthHeader(_props) {
  const props = useMergeProps.default(_props);
  const {
    prefixCls,
    generateConfig,
    locale,
    viewDate,
    onNextYear,
    onPrevYear,
    onYearClick
  } = props;
  const {
    hideHeader
  } = PanelContext.useInjectPanel();
  if (hideHeader.value)
    return null;
  const headerPrefixCls = `${prefixCls}-header`;
  return vue.createVNode(Header.default, {
    ...props,
    "prefixCls": headerPrefixCls,
    "onSuperPrev": onPrevYear,
    "onSuperNext": onNextYear
  }, {
    default: () => [vue.createVNode("button", {
      "type": "button",
      "onClick": onYearClick,
      "class": `${prefixCls}-year-btn`
    }, [dateUtil.formatValue(viewDate, {
      locale,
      format: locale.yearFormat,
      generateConfig
    })])]
  });
}
MonthHeader.displayName = "MonthHeader";
MonthHeader.inheritAttrs = false;

exports.default = MonthHeader;
//# sourceMappingURL=MonthHeader.cjs.map
