"use strict";

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

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

var _native = _interopRequireDefault(require("styled-components/native"));

var _styledSystem = require("styled-system");

var _theme = require("../../../theme");

var _customProps = require("../../../utils/customProps");

var _reactNative = require("react-native");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

const StyledText = (0, _native.default)(_reactNative.Text)(_styledSystem.color, _styledSystem.space, _styledSystem.position, _styledSystem.layout, _styledSystem.flexbox, _styledSystem.border, _styledSystem.typography, _customProps.customBorder, _customProps.customBackground, _customProps.customOutline, _customProps.customShadow, _customProps.customExtra, _customProps.customLayout, _customProps.customTypography);

const Text = ({
  children,
  style,
  isTruncated,
  noOfLines,
  bold,
  italic,
  sub,
  highlight,
  underline,
  strikeThrough,
  ...props
}) => {
  const newProps = (0, _theme.usePropsConfig)('Text', props);
  return /*#__PURE__*/_react.default.createElement(StyledText, _extends({
    numberOfLines: noOfLines ? noOfLines : isTruncated ? 1 : 999,
    fontWeight: bold ? 'bold' : undefined,
    fontStyle: italic ? 'italic' : undefined,
    bg: highlight ? 'yellow.200' : undefined,
    textDecorationLine: underline ? 'underline' : strikeThrough ? 'line-through' : undefined
  }, newProps, {
    fontSize: sub ? 10 : newProps.fontSize,
    style: style
  }), children);
};

var _default = Text;
exports.default = _default;
//# sourceMappingURL=index.js.map