import React, { useState, useCallback } from 'react' import Breadcrumbs from '../../components/forum/Breadcrumbs' import Button from '../../components/ui/Button' import RichTextEditor from '../../components/forum/RichTextEditor' export default function ForumEditPost({ post, thread, csrfToken, errors = {} }) { const [content, setContent] = useState(post?.content ?? '') const [submitting, setSubmitting] = useState(false) const breadcrumbs = [ { label: 'Home', href: '/' }, { label: 'Forum', href: '/forum' }, { label: thread?.title ?? 'Thread', href: thread?.id ? `/forum/thread/${thread.id}-${thread.slug ?? ''}` : '/forum' }, { label: 'Edit post' }, ] const handleSubmit = useCallback((e) => { if (submitting) return setSubmitting(true) // Let the form submit normally for PRG }, [submitting]) return (
{/* Header */}

Edit

Edit post

{/* Form */}
{/* Rich text editor */}
{/* Actions */}
← Cancel
) }