"use client"; import { useEffect, useState } from "react"; import { fmtDate } from "@/lib/format"; type R = { id: string; targetType: string; targetId: string; reason: string; details: string | null; status: string; createdAt: string }; export function AdminReports() { const [status, setStatus] = useState("OPEN"); const [rows, setRows] = useState([]); const load = () => fetch(`/api/admin/reports?status=${status}`).then((r) => r.json()).then((j) => setRows(j.items ?? [])); useEffect(() => { load(); }, [status]); // eslint-disable-line react-hooks/exhaustive-deps const act = async (id: string, s: string) => { await fetch("/api/admin/reports", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ id, status: s }) }); load(); }; const link = (r: R) => r.targetType === "AGGREGATED_LISTING" ? `/annonce/${encodeURIComponent(r.targetId)}` : r.targetType === "LISTING" ? `/admin/annonces?id=${r.targetId}` : null; return (

Signalements

Pour une annonce agrégée, « Résolu » signifie que la demande a été transmise/traitée côté source ; l'annonce disparaîtra à la prochaine synchronisation si la source la retire.

); }