"use strict";

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _TooltipComponent = _interopRequireDefault(require("../TooltipComponent"));

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

/** Label Component */
// const Label = props => (<div {...props.attributes}>
//   <div style={{ display: 'flex' }} >
//     <span>{props.attributes.text}</span>
//     {props.attributes.tooltip && <TooltipComponent tooltip={props.attributes.tooltip} />}</div>
// </div>);
function Label(props) {
  var library = props.library,
      component = props.component,
      attributes = props.attributes;
  var TYPOGRAPHY = library[component];
  return _react.default.createElement("div", {
    style: {
      display: 'flex'
    }
  }, _react.default.createElement(TYPOGRAPHY, attributes, attributes.text), attributes.tooltip && _react.default.createElement(_TooltipComponent.default, {
    tooltip: attributes.tooltip
  }));
}

Label.propTypes = process.env.NODE_ENV !== "production" ? {
  attributes: _propTypes.default.object,
  library: _propTypes.default.object,
  component: _propTypes.default.string.isRequired
} : {};
Label.defaultProps = {
  attributes: null,
  library: null
};
var _default = Label;
exports.default = _default;