"use client"; import { useState } from "react"; import Link from "next/link"; import { api } from "@/lib/api"; import { useAuth } from "@/lib/auth"; import { useToast } from "@/lib/toast"; import { useI18n } from "@/lib/i18n"; export default function FeedbackClient() { const { token } = useAuth(); const { toast } = useToast(); const { t } = useI18n(); const [content, setContent] = useState(""); const [category, setCategory] = useState("general"); const [loading, setLoading] = useState(false); const submit = async () => { if (!content.trim()) return; setLoading(true); try { await api.submitFeedback(content.trim(), token || undefined, category); toast(t.feedback.ok, "success"); setContent(""); } catch { toast(t.feedback.fail, "error"); } finally { setLoading(false); } }; return (
{t.feedback.tag}

{t.feedback.title}

{t.feedback.subtitle}