import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { defaultJSXConverters } from './converter/defaultConverters.js';
import { convertLexicalToJSX } from './converter/index.js';
import './index.css';
export const RichText = ({
  className,
  converters,
  data: editorState,
  disableIndent,
  disableTextAlign
}) => {
  if (!editorState) {
    return null;
  }
  let finalConverters = {};
  if (converters) {
    if (typeof converters === 'function') {
      finalConverters = converters({
        defaultConverters: defaultJSXConverters
      });
    } else {
      finalConverters = converters;
    }
  } else {
    finalConverters = defaultJSXConverters;
  }
  return /*#__PURE__*/_jsx("div", {
    className: className ?? 'payload-richtext',
    children: editorState && !Array.isArray(editorState) && typeof editorState === 'object' && 'root' in editorState && convertLexicalToJSX({
      converters: finalConverters,
      data: editorState,
      disableIndent,
      disableTextAlign
    })
  });
};
//# sourceMappingURL=index.js.map