'use strict';

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

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

function DecadeHeader(_props) {
  const props = useMergeProps.default(_props);
  const {
    prefixCls,
    generateConfig,
    viewDate,
    onPrevDecades,
    onNextDecades
  } = props;
  const {
    hideHeader
  } = PanelContext.useInjectPanel();
  if (hideHeader)
    return null;
  const headerPrefixCls = `${prefixCls}-header`;
  const yearNumber = generateConfig.getYear(viewDate);
  const startYear = Math.floor(yearNumber / constant.DECADE_DISTANCE_COUNT) * constant.DECADE_DISTANCE_COUNT;
  const endYear = startYear + constant.DECADE_DISTANCE_COUNT - 1;
  return vue.createVNode(Header.default, {
    ...props,
    "prefixCls": headerPrefixCls,
    "onSuperPrev": onPrevDecades,
    "onSuperNext": onNextDecades
  }, {
    default: () => [startYear, vue.createTextVNode("-"), endYear]
  });
}
DecadeHeader.displayName = "DecadeHeader";
DecadeHeader.inheritAttrs = false;

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