"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TextWrapper = void 0;
var _react = _interopRequireDefault(require("react"));
var _shared = require("../shared");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var TextWrapper = exports.TextWrapper = function TextWrapper(_ref) {
  var children = _ref.children,
    _ref$weight = _ref.weight,
    weight = _ref$weight === void 0 ? 'bold' : _ref$weight,
    _ref$truncate = _ref.truncate,
    truncate = _ref$truncate === void 0 ? true : _ref$truncate,
    className = _ref.className;
  if (!truncate) {
    return _react.default.createElement(_shared.Text, {
      className: className,
      weight: weight,
      color: function color(t) {
        return t.color.text;
      }
    }, children);
  }
  return _react.default.createElement(_shared.StyledTruncateTooltip, {
    label: children
  }, _react.default.createElement(_shared.Text, {
    className: className,
    weight: weight,
    color: function color(t) {
      return t.color.text;
    }
  }, children));
};