import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
import Box from '../box';
import { TextSmall } from '../typography';

var ProgressStep = /*#__PURE__*/function (_PureComponent) {
  _inherits(ProgressStep, _PureComponent);

  var _super = _createSuper(ProgressStep);

  function ProgressStep() {
    _classCallCheck(this, ProgressStep);

    return _super.apply(this, arguments);
  }

  _createClass(ProgressStep, [{
    key: "render",
    value: function render() {
      var _cx;

      var _this$props = this.props,
          label = _this$props.label,
          meta = _this$props.meta,
          active = _this$props.active,
          completed = _this$props.completed,
          onClick = _this$props.onClick;
      var classNames = cx(theme['step'], (_cx = {}, _defineProperty(_cx, theme['is-active'], active), _defineProperty(_cx, theme['is-completed'], completed), _defineProperty(_cx, theme['is-clickable'], !!onClick), _defineProperty(_cx, theme['has-meta'], !!meta), _cx));
      return /*#__PURE__*/React.createElement(Box, {
        className: classNames
      }, /*#__PURE__*/React.createElement("div", {
        className: theme['step-label-holder']
      }, /*#__PURE__*/React.createElement(TextSmall, {
        className: theme['step-label']
      }, label), meta && /*#__PURE__*/React.createElement(TextSmall, {
        className: theme['step-meta']
      }, meta)), /*#__PURE__*/React.createElement("span", {
        className: theme['status-bullet-halo'],
        onClick: onClick
      }), /*#__PURE__*/React.createElement("span", {
        className: theme['status-bullet'],
        onClick: onClick
      }));
    }
  }]);

  return ProgressStep;
}(PureComponent);

ProgressStep.defaultProps = {
  active: false,
  completed: false
};
export default ProgressStep;