import { FC } from "react"; import { LexicalComposer } from "@lexical/react/LexicalComposer"; import { ContentEditable } from "@lexical/react/LexicalContentEditable"; import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin"; import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin"; import { ListPlugin } from "@lexical/react/LexicalListPlugin"; import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin"; import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin"; import { TRANSFORMERS } from "@lexical/markdown"; // custom plugins import { CodeHighlightPlugin } from "./plugins/code-highlight"; import ReadOnlyPlugin from "./plugins/read-only"; // config import { initialConfig } from "./config"; // helpers import { getValidatedValue } from "./helpers/editor"; export interface RichTextViewerProps { id: string; value: string; } const RichTextViewer: FC = (props) => { // props const { value, id } = props; return (
} placeholder={
Enter some text...
} />
); }; export default RichTextViewer;