import b from "../../../../@babel/runtime/helpers/esm/extends.mjs";
import * as n from "react";
import k from "../Header.mjs";
import y from "../../PanelContext.mjs";
import { formatValue as c } from "../../utils/dateUtil.mjs";
function D(e) {
  var a = e.prefixCls, o = e.generateConfig, t = e.locale, r = e.viewDate, h = e.onNextMonth, i = e.onPrevMonth, f = e.onNextYear, x = e.onPrevYear, C = e.onYearClick, v = e.onMonthClick, d = n.useContext(y), u = d.hideHeader;
  if (u)
    return null;
  var g = "".concat(a, "-header"), N = t.shortMonths || (o.locale.getShortMonths ? o.locale.getShortMonths(t.locale) : []), M = o.getMonth(r), l = /* @__PURE__ */ n.createElement("button", {
    type: "button",
    key: "year",
    onClick: C,
    tabIndex: -1,
    className: "".concat(a, "-year-btn")
  }, c(r, {
    locale: t,
    format: t.yearFormat,
    generateConfig: o
  })), m = /* @__PURE__ */ n.createElement("button", {
    type: "button",
    key: "month",
    onClick: v,
    tabIndex: -1,
    className: "".concat(a, "-month-btn")
  }, t.monthFormat ? c(r, {
    locale: t,
    format: t.monthFormat,
    generateConfig: o
  }) : N[M]), s = t.monthBeforeYear ? [m, l] : [l, m];
  return /* @__PURE__ */ n.createElement(k, b({}, e, {
    prefixCls: g,
    onSuperPrev: x,
    onPrev: i,
    onNext: h,
    onSuperNext: f
  }), s);
}
export {
  D as default
};
