import React, { useContext } from 'react';
import ConfigContext from '../../../es/config-provider/ConfigContext';
import { observer } from 'mobx-react-lite';
import { $l } from '../locale-context';
import Button from '../button/Button';
import { ButtonColor } from '../button/enum';

var CountDownButton = function CountDownButton(props) {
  var _useContext = useContext(ConfigContext),
      getProPrefixCls = _useContext.getProPrefixCls;

  var prefixCls = getProPrefixCls('secret-field');
  var onClick = props.onClick,
      countDown = props.countDown,
      verifyNumber = props.verifyNumber;
  var count = countDown.count;
  return /*#__PURE__*/React.createElement(Button, {
    className: "".concat(prefixCls, "-modal-verify-btn"),
    color: ButtonColor.primary,
    disabled: count > 0 || !verifyNumber,
    onClick: onClick
  }, count > 0 ? "".concat(count, "s") : $l('SecretField', 'get_verify_code'));
};

CountDownButton.displayName = 'CountDownButton';
export default observer(CountDownButton);
//# sourceMappingURL=CountDownButton.js.map
