import React, { useContext } from "react";
import classNames from "classnames";
import ConfigProviderContext from "../config-provider/ConfigProviderContext";
const CalendarHeader = (props) => {
  const {
    prefixCls,
    createNamespace
  } = useContext(ConfigProviderContext);
  const [bem] = createNamespace("calendar", prefixCls);
  const {
    onClickSubtitle,
    showTitle,
    showSubtitle,
    firstDayOfWeek
  } = props;
  const renderTitle = () => {
    const {
      title
    } = props;
    return showTitle ? /* @__PURE__ */ React.createElement("div", {
      className: classNames(bem("header-title"))
    }, title) : null;
  };
  const renderSubtitle = () => {
    const title = props.subtitle;
    return showSubtitle ? /* @__PURE__ */ React.createElement("div", {
      className: classNames(bem("header-subtitle")),
      onClick: onClickSubtitle
    }, title) : null;
  };
  const renderWeekDays = () => {
    const weekdays = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
    const renderWeekDaysArr = [...weekdays.slice(firstDayOfWeek, 7), ...weekdays.slice(0, firstDayOfWeek)];
    return /* @__PURE__ */ React.createElement("div", {
      className: classNames(bem("weekdays"))
    }, renderWeekDaysArr.map((text, index) => /* @__PURE__ */ React.createElement("span", {
      key: String(index),
      className: classNames(bem("weekday"))
    }, text)));
  };
  return /* @__PURE__ */ React.createElement("div", {
    className: classNames(bem("header"))
  }, renderTitle(), renderSubtitle(), renderWeekDays());
};
var stdin_default = CalendarHeader;
export {
  stdin_default as default
};
