Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 48s
Add copyright notice / copyright_notice (pull_request) Successful in 1m56s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m30s
Playwright Tests / test (pull_request) Failing after 10m28s
22 lines
546 B
TypeScript
22 lines
546 B
TypeScript
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
|
|
|
'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
|