import { useState } from "react"; import { api } from "../lib/api"; export function FeedbackForm({ pageId, revisionId }: { pageId: string; revisionId: string }) { const [message, setMessage] = useState(""); const [status, setStatus] = useState(null); async function submit(helpful: boolean) { try { await api.post("/api/feedback", { pageId, revisionId, helpful, comment: message || undefined }); setStatus("Thanks for the feedback."); setMessage(""); } catch (error) { setStatus(error instanceof Error ? error.message : "Could not save feedback."); } } return (

Feedback

Was this article helpful?