// Copyright (C) 2026 billisdead — Licence EUPL-1.2 import React from "react"; import { Link } from "wouter"; import { format } from "date-fns"; import { fr } from "date-fns/locale"; import { ArrowLeft, Download, ChevronLeft, ChevronRight, Loader2, AlertCircle, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Alert, AlertDescription } from "@/components/ui/alert"; const API_BASE = import.meta.env.VITE_API_URL ?? ""; const PER_PAGE = 20; interface Contribution { id: number; content: string; author: string | null; createdAt: string; } interface ContributionsResponse { contributions: Contribution[]; total: number; page: number; perPage: number; pages: number; } export default function ContributionsBrutes() { const [page, setPage] = React.useState(1); const [data, setData] = React.useState(null); const [loading, setLoading] = React.useState(true); const [error, setError] = React.useState(false); React.useEffect(() => { setLoading(true); setError(false); fetch(`${API_BASE}/api/contributions?page=${page}&per_page=${PER_PAGE}`) .then((res) => { if (!res.ok) throw new Error(); return res.json() as Promise; }) .then((d) => { setData(d); setLoading(false); }) .catch(() => { setError(true); setLoading(false); }); }, [page]); return (

Contributions brutes

L'intégralité des contributions acceptées, dans leur ordre de soumission, sans mise en forme éditoriale.

{/* Avertissement éditorial */} La{" "} synthèse collective {" "} visible sur la page d'accueil est une interprétation thématique automatisée de ces contributions. Elle peut regrouper, omettre ou reformuler des expressions individuelles. Cette page est la source primaire pour vérification. {/* Boutons d'export */}
{/* Contenu */} {loading ? (
) : error ? (
Impossible de charger les contributions.
) : data && data.contributions.length > 0 ? ( <>

{data.total} contribution{data.total !== 1 ? "s" : ""} acceptée{data.total !== 1 ? "s" : ""} {" "}— page {data.page} / {data.pages}

{data.contributions.map((c) => (

{c.content}

{c.author || "Citoyen anonyme"} {format(new Date(c.createdAt), "d MMMM yyyy, HH:mm", { locale: fr })} #{c.id}
))}
{/* Pagination */} {data.pages > 1 && (
{page} / {data.pages}
)} ) : (
Aucune contribution acceptée pour l'instant.
)}

Contributions modérées selon le droit international des droits humains (DUDH · PIDCP · CEDH).{" "} Voir les critères de modération .

); }