"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = TodayButton;

var _react = _interopRequireDefault(require("react"));

var _util = require("../util/");

function TodayButton(_ref) {
  var prefixCls = _ref.prefixCls,
      locale = _ref.locale,
      value = _ref.value,
      timePicker = _ref.timePicker,
      disabled = _ref.disabled,
      disabledDate = _ref.disabledDate,
      onToday = _ref.onToday,
      text = _ref.text;
  var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
  var disabledToday = disabledDate && !(0, _util.isAllowedDate)((0, _util.getTodayTime)(value), disabledDate);
  var isDisabled = disabledToday || disabled;
  var disabledTodayClass = isDisabled ? "".concat(prefixCls, "-today-btn-disabled") : '';
  return /*#__PURE__*/_react["default"].createElement("a", {
    className: "".concat(prefixCls, "-today-btn ").concat(disabledTodayClass),
    role: "button",
    onClick: isDisabled ? null : onToday,
    title: (0, _util.getTodayTimeStr)(value)
  }, localeNow);
}
//# sourceMappingURL=TodayButton.js.map
