@@ -123,6 +123,12 @@ export function RichTextEditor({
123123 return editor . getText ( ) . length ;
124124 } ;
125125
126+ const getWordCount = ( ) => {
127+ const text = editor . getText ( ) . trim ( ) ;
128+ if ( ! text ) return 0 ;
129+ return text . split ( / \s + / ) . length ;
130+ } ;
131+
126132 const handleImageUpload = ( ) => {
127133 fileInputRef . current ?. click ( ) ;
128134 } ;
@@ -172,7 +178,7 @@ export function RichTextEditor({
172178 } ;
173179
174180 return (
175- < div className = "space-y-2" >
181+ < div >
176182 { /* Toolbar */ }
177183 < div className = { `rounded-t border p-2 ${
178184 error
@@ -463,7 +469,7 @@ export function RichTextEditor({
463469 </ div >
464470
465471 { /* Editor */ }
466- < div className = { `rounded-b border ${
472+ < div className = { `rounded-b border -mt-1 ${
467473 error
468474 ? 'border-t-0 border-red-500 bg-red-50'
469475 : 'border-t-0 border-slate-300 bg-slate-50'
@@ -475,9 +481,9 @@ export function RichTextEditor({
475481 </ div >
476482
477483 { /* Character count and error */ }
478- < div className = "flex items-start justify-between text-xs" >
484+ < div className = "flex items-start justify-between text-xs mt-2 " >
479485 < div className = "text-slate-500" >
480- { getCharacterCount ( ) } characters
486+ { getCharacterCount ( ) } characters | { getWordCount ( ) } words
481487 </ div >
482488 { error && (
483489 < div className = "flex items-center gap-1 text-red-600" >
0 commit comments