/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { getFormattedMessage } from '../../../utils';
const baseStyle = null;
const fontOverrideStyleMap = {
  'font.body': "_11c8fhey",
  'font.body.large': "_11c81d4k",
  'font.body.small': "_11c8wadc",
  'font.body.UNSAFE_small': "_11c8rymc"
};
/**
 * A base element that displays some Text.
 * @internal
 * @param {TextProps} TextProps - The props necessary for the Text element.
 * @see Title
 */
export const BaseTextElement = ({
  content,
  maxLines = 1,
  message,
  name,
  className,
  testId = 'smart-element-text',
  hideFormat = false,
  color,
  fontSize
}) => {
  if (!message && !content) {
    return null;
  }
  const dynamicCss = null;
  const formattedContent = hideFormat && content ? content : getFormattedMessage(message) || content;
  return /*#__PURE__*/React.createElement("span", {
    "data-separator": true,
    "data-smart-element": name,
    "data-smart-element-text": true,
    "data-testid": testId
    // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
    ,
    className: ax(["_11c8wadc _1reo15vq _18m915vq _syazazsu _o5724jg8 _1e0ccj1k _1ul9idpf _1bto1l2s _1nmz1hna _sudp1e54", fontSize !== undefined && fontOverrideStyleMap[fontSize], "_1yyjr31u _102k1dud", className]),
    style: {
      color,
      "--_1erfju8": ix(maxLines)
    }
  }, formattedContent);
};
export default BaseTextElement;
export const toFormattedTextProps = (descriptor, context) => {
  return context ? {
    message: {
      descriptor,
      values: {
        context
      }
    },
    content: context
  } : undefined;
};
export const toTextProps = content => {
  return content ? {
    content
  } : undefined;
};