"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 className = _ref.className,
    _ref$truncate = _ref.truncate,
    truncate = _ref$truncate === void 0 ? true : _ref$truncate,
    weight = _ref.weight,
    children = _ref.children;
  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));
};