'use strict';

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

var vue = require('vue');
var Header = require('../Header.js');
var useMergeProps = require('../../hooks/useMergeProps.js');
var PanelContext = require('../../PanelContext.js');
var constants = require('../constants.js');

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 / constants.DECADE_DISTANCE_COUNT) * constants.DECADE_DISTANCE_COUNT;
  const endYear = startYear + constants.DECADE_DISTANCE_COUNT - 1;
  return vue.createVNode(Header.default, vue.mergeProps(props, {
    "prefixCls": headerPrefixCls,
    "onSuperPrev": onPrevDecades,
    "onSuperNext": onNextDecades
  }), {
    default: () => [startYear, vue.createTextVNode("-"), endYear]
  });
}
DecadeHeader.displayName = "DecadeHeader";
DecadeHeader.inheritAttrs = false;

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