"use client"; import { FormEvent, useEffect, useRef, useState } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useAccount } from "@/contexts/AccountContext"; import { FORUM_RINGS } from "@/lib/forumRings"; import { addThread } from "@/lib/forumState"; export default function VoidAggregateSubmitPage() { const router = useRouter(); const { user, hydrated } = useAccount(); const prefilledAuthor = useRef(false); const [topicSlug, setTopicSlug] = useState(FORUM_RINGS[0]!.slug); const [title, setTitle] = useState(""); const [body, setBody] = useState(""); const [author, setAuthor] = useState(""); useEffect(() => { if (!hydrated || !user || prefilledAuthor.current) return; setAuthor(user.displayName); prefilledAuthor.current = true; }, [hydrated, user]); useEffect(() => { if (typeof window === "undefined") return; const q = new URLSearchParams(window.location.search).get("ring"); if (q && FORUM_RINGS.some((r) => r.slug === q)) setTopicSlug(q); }, []); const onSubmit = (e: FormEvent) => { e.preventDefault(); if (!title.trim() || !body.trim()) return; const t = addThread({ topicSlug, title, body, author, }); router.push(`/forum/post/${t.id}`); }; return (
← Back to feed

Create submission

Pick a ring, write a title, drop your text. Unsigned posts are untrusted.

setAuthor(e.target.value)} className="mt-2 w-full rounded border-2 border-[#3d3228] bg-[#0d0a07] px-4 py-3 font-mono text-sm text-[#e7d9c8] placeholder:text-[#5c5044] focus:border-[#ff9a3c] focus:outline-none" placeholder="Alias" />
setTitle(e.target.value)} required className="mt-2 w-full rounded border-2 border-[#3d3228] bg-[#0d0a07] px-4 py-3 font-mono text-sm text-[#e7d9c8] placeholder:text-[#5c5044] focus:border-[#ff9a3c] focus:outline-none" placeholder="Be specific — searchable titles get better replies" />