Manuel Bustillo 82f9cf8e4b
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m20s
Add copyright notice / copyright_notice (pull_request) Successful in 1m28s
Playwright Tests / test (pull_request) Successful in 6m58s
Initial steps to create a WYSIWYG for the website
2025-06-08 20:03:23 +02:00

20 lines
483 B
TypeScript

'use client'
import { useEditor, EditorContent } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
const Tiptap = ({ content, onUpdate }: { content: string, onUpdate: (newContent:string) => void }) => {
const editor = useEditor({
extensions: [StarterKit],
content: content || '<p>Type something here...</p>',
onUpdate({ editor }) {
onUpdate(editor.getHTML());
},
})
return <EditorContent editor={editor} />
}
export default Tiptap