// Center pane — doc kicker, title, Write/Preview toggle, markdown body, // footer with word-count and autosave note. function Editor({ trip, date, day, media, title, setTitle, body, setBody, mode, setMode, saveState, onMarkDirty }) { const titleRef = React.useRef(); React.useEffect(() => { const ta = titleRef.current; if (!ta) return; ta.style.height = "auto"; ta.style.height = ta.scrollHeight + "px"; }, [title]); const wordCount = React.useMemo( () => (body || "").trim().split(/\s+/).filter(Boolean).length, [body] ); return (
{kicker(date, trip)}