"use client"; import { useState } from "react"; export function ReportForm({ slug }: { slug: string }) { const [state, setState] = useState<"idle" | "sending" | "done" | "error">("idle"); const [msg, setMsg] = useState(""); return (
{ e.preventDefault(); setState("sending"); const fd = new FormData(e.currentTarget); const r = await fetch("/api/report", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ slug, message: fd.get("message"), contact: fd.get("contact"), website: fd.get("website") }) }); setState(r.ok ? "done" : "error"); if (!r.ok) setMsg((await r.json().catch(() => ({}))).error ?? "Could not send"); }}>

Broken link, outdated license, wrong category, or a tool that no longer exists? Tell us; reports are reviewed by the editor.