import "react";
import Button from "../../Button/index.js";
import Shortcuts from "./shortcuts.js";
import { isArray } from "../../_util/is.js";
import Link from "../../Link/index.js";
import { jsxs, jsx, Fragment } from "../../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
function Footer(props) {
  var showTime = props.showTime, prefixCls = props.prefixCls, DATEPICKER_LOCALE = props.DATEPICKER_LOCALE, disabled = props.disabled, onClickConfirmBtn = props.onClickConfirmBtn, onClickSelectTimeBtn = props.onClickSelectTimeBtn, isTimePanel = props.isTimePanel, onSelectNow = props.onSelectNow, showNowBtn = props.showNowBtn, shortcuts = props.shortcuts, onMouseEnterShortcut = props.onMouseEnterShortcut, onMouseLeaveShortcut = props.onMouseLeaveShortcut, onSelectShortcut = props.onSelectShortcut, extra = props.extra, mode = props.mode, shortcutsPlacementLeft = props.shortcutsPlacementLeft;
  var hasShortcuts = isArray(shortcuts) && shortcuts.length > 0;
  var shouldShowNowBtn = showNowBtn && showTime && !hasShortcuts;
  var shouldShouldShortcuts = shouldShowNowBtn || hasShortcuts && !shortcutsPlacementLeft;
  return /* @__PURE__ */ jsxs("div", {
    className: prefixCls + "-footer",
    children: [extra && /* @__PURE__ */ jsx("div", {
      className: prefixCls + "-footer-extra-wrapper",
      children: extra
    }), !showTime && showNowBtn && mode === "date" && /* @__PURE__ */ jsx("div", {
      className: prefixCls + "-footer-now-wrapper",
      children: /* @__PURE__ */ jsx(Link, {
        onClick: onSelectNow,
        children: DATEPICKER_LOCALE.today
      })
    }), shouldShouldShortcuts || showTime ? /* @__PURE__ */ jsxs("div", {
      className: prefixCls + "-footer-btn-wrapper",
      children: [!shortcutsPlacementLeft ? /* @__PURE__ */ jsx(Shortcuts, {
        shortcuts,
        prefixCls,
        onSelectNow,
        nowText: DATEPICKER_LOCALE.now,
        showNowBtn,
        onMouseEnterShortcut,
        onMouseLeaveShortcut,
        onSelectShortcut,
        showTime
      }) : /* @__PURE__ */ jsx("div", {}), showTime && /* @__PURE__ */ jsxs(Fragment, {
        children: [/* @__PURE__ */ jsx(Button, {
          type: "text",
          size: "mini",
          onClick: onClickSelectTimeBtn,
          className: isTimePanel ? prefixCls + "-btn-select-date" : prefixCls + "-btn-select-time",
          children: isTimePanel ? DATEPICKER_LOCALE.selectDate : DATEPICKER_LOCALE.selectTime
        }), /* @__PURE__ */ jsx(Button, {
          className: prefixCls + "-btn-confirm",
          type: "primary",
          size: "mini",
          disabled,
          onClick: onClickConfirmBtn,
          children: DATEPICKER_LOCALE.ok
        })]
      })]
    }) : null]
  });
}
export {
  Footer as default
};
//# sourceMappingURL=footer.js.map
