feat: add emoji picker to post editor

This commit is contained in:
codytseng 2025-05-27 22:39:57 +08:00
parent 061e38a78f
commit 9edd61db78
4 changed files with 78 additions and 9 deletions

View file

@ -19,6 +19,7 @@ import suggestion from './suggestion'
export type TPostTextareaHandle = {
appendText: (text: string) => void
insertText: (text: string) => void
}
const PostTextarea = forwardRef<
@ -94,6 +95,11 @@ const PostTextarea = forwardRef<
.insertContent(text)
.run()
}
},
insertText: (text: string) => {
if (editor) {
editor.chain().focus().insertContent(text).run()
}
}
}))