"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LabeledValue = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _Typography = _interopRequireDefault(require("../../Atoms/Typography"));
var _utils = require("../../common/utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var StyledLabeledValue = _styledComponents.default.div.withConfig({
  displayName: "LabeledValue__StyledLabeledValue",
  componentId: "sc-hatse2-0"
})(["display:flex;flex-direction:column;"]);
var StyledLabel = _styledComponents.default.div.withConfig({
  displayName: "LabeledValue__StyledLabel",
  componentId: "sc-hatse2-1"
})(["margin-bottom:", "px;"], function (p) {
  return p.theme.spacing.unit(1);
});
var LabeledValue = exports.LabeledValue = function LabeledValue(_ref) {
  var children = _ref.children,
    className = _ref.className,
    label = _ref.label;
  var pageHeaderTitle = function pageHeaderTitle() {
    if ((0, _utils.isElement)(label)) {
      return label;
    }
    return _react.default.createElement(_Typography.default, {
      type: "secondary",
      color: function color(t) {
        return t.color.label;
      }
    }, label);
  };
  return _react.default.createElement(StyledLabeledValue, {
    className: className
  }, _react.default.createElement(StyledLabel, null, pageHeaderTitle()), children);
};