'use strict';

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

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _dec, _class, _class2, _temp;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _MetricsList = require('@instructure/ui-elements/lib/components/MetricsList');

var _ScreenReaderContent = require('@instructure/ui-a11y/lib/components/ScreenReaderContent');

var _ScreenReaderContent2 = _interopRequireDefault(_ScreenReaderContent);

var _PresentationContent = require('@instructure/ui-a11y/lib/components/PresentationContent');

var _PresentationContent2 = _interopRequireDefault(_PresentationContent);

var _lib = require('@instructure/ui-themeable/lib');

var _lib2 = _interopRequireDefault(_lib);

var _formatMessage = require('@instructure/quiz-common/lib/format-message');

var _formatMessage2 = _interopRequireDefault(_formatMessage);

var _theme = require('./theme');

var _theme2 = _interopRequireDefault(_theme);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n.MetricsListItem__styles__root {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: center;\n}\n';
  },
  'root': 'MetricsListItem__styles__root'
};
var MetricsListItem = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(MetricsListItem, _Component);

  function MetricsListItem() {
    (0, _classCallCheck3.default)(this, MetricsListItem);
    return (0, _possibleConstructorReturn3.default)(this, (MetricsListItem.__proto__ || Object.getPrototypeOf(MetricsListItem)).apply(this, arguments));
  }

  (0, _createClass3.default)(MetricsListItem, [{
    key: 'renderNoValue',
    value: function renderNoValue() {
      return _react2.default.createElement(
        'span',
        null,
        _react2.default.createElement(
          _ScreenReaderContent2.default,
          null,
          'Brak warto\u015Bci'
        ),
        _react2.default.createElement(
          _PresentationContent2.default,
          null,
          '--'
        )
      );
    }
  }, {
    key: 'render',
    value: function render() {
      var names = (0, _classnames2.default)(styles.root, this.props.className);
      var _props = this.props,
          value = _props.value,
          label = _props.label;

      return _react2.default.createElement(
        'div',
        { className: names },
        _react2.default.createElement(_MetricsList.MetricsListItem, {
          label: label,
          value: value || this.renderNoValue()
        })
      );
    }
  }]);
  MetricsListItem.displayName = 'MetricsListItem'
  ;
  return MetricsListItem;
}(_react.Component), _class2.propTypes = Object.assign({}, _MetricsList.MetricsListItem.propTypes, {
  className: _propTypes2.default.string
}), _class2.defaultProps = {
  className: ''
}, _temp)) || _class);
exports.default = MetricsListItem;