import { EditorContent, useEditor } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import TextAlign from '@tiptap/extension-text-align';
import { DemoExtension } from './DemoExtension';
const Demo = () => {
const editor = useEditor({
extensions: [
StarterKit,
TextAlign.configure({
types: ['heading', 'paragraph'],
}),
DemoExtension.configure({
defaultWidth: 200,
defaultHeight: 200,
}),
],
content: `
<p>
<img
src="/example.jpg"
alt="image alt"
title="image title"
width="300"
data-keep-ratio="true"
>
</p>
`,
immediatelyRender: false,
});
return (
<div>
<EditorContent editor={editor} className='editor' />
</div>
);
};
export default Demo;