"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _InvalidUnit = require("./InvalidUnit");

var _excluded = ["style"];

var SvgUnit = function SvgUnit(value, props) {
  var style = props.style,
      other = (0, _objectWithoutProperties2.default)(props, _excluded);
  if (value) return /*#__PURE__*/_react.default.createElement("text", (0, _extends2.default)({
    className: props.className
  }, other), /*#__PURE__*/_react.default.createElement("tspan", {
    style: style
  }, value.before, " "), /*#__PURE__*/_react.default.createElement("tspan", {
    style: style
  }, value.value), /*#__PURE__*/_react.default.createElement("tspan", {
    style: style
  }, ' ', value.output ? value.output.default.after + '' : '', value.after));else return /*#__PURE__*/_react.default.createElement(_InvalidUnit.InvalidSvg, {
    className: props.className
  });
};

var _default = SvgUnit;
exports.default = _default;