feat: add placeholder extension to simple editor component

This commit is contained in:
Yoga Pangestu 2026-04-17 22:22:53 +07:00
parent 4d6db252df
commit 6c21c66e12

View File

@ -12,7 +12,7 @@ import { Typography } from "@tiptap/extension-typography"
import { Highlight } from "@tiptap/extension-highlight" import { Highlight } from "@tiptap/extension-highlight"
import { Subscript } from "@tiptap/extension-subscript" import { Subscript } from "@tiptap/extension-subscript"
import { Superscript } from "@tiptap/extension-superscript" import { Superscript } from "@tiptap/extension-superscript"
import { Selection } from "@tiptap/extensions" import { Placeholder, Selection } from "@tiptap/extensions"
// --- UI Primitives --- // --- UI Primitives ---
import { Button } from "@/components/tiptap-ui-primitive/button" import { Button } from "@/components/tiptap-ui-primitive/button"
@ -223,6 +223,9 @@ export function SimpleEditor({ value, onChange }: SimpleEditorProps) {
upload: handleImageUpload, upload: handleImageUpload,
onError: (error) => console.error("Upload failed:", error), onError: (error) => console.error("Upload failed:", error),
}), }),
Placeholder.configure({
placeholder : 'Ketikkan sesuatu...'
})
], ],
content: value, content: value,
onUpdate: ({ editor }) => { onUpdate: ({ editor }) => {