Files
Epicure/apps/web/app/admin/reports/page.tsx
T
Arnaud 57c29f62b4 feat: user blocking and content reporting/flagging
- user_blocks table (composite PK), Block/Unblock button on profiles.
  Blocking severs any existing follow relationship both ways and
  prevents the blocked party from following, commenting on the
  blocker's recipes, or the blocker from seeing their comments.
- reports table (recipe/comment/user targets, pending/reviewed/
  dismissed status). ReportButton on comments, admin review queue at
  /admin/reports with dismiss/mark-reviewed actions, audit-logged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 22:09:14 +02:00

38 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Metadata } from "next";
import { db, reports, users, eq, desc } from "@epicure/db";
import { ReportsQueue } from "@/components/admin/reports-queue";
export const metadata: Metadata = { title: "Reports Admin" };
export default async function AdminReportsPage() {
const rows = await db
.select({
id: reports.id,
targetType: reports.targetType,
targetId: reports.targetId,
reason: reports.reason,
createdAt: reports.createdAt,
reporterName: users.name,
reporterEmail: users.email,
})
.from(reports)
.innerJoin(users, eq(reports.reporterId, users.id))
.where(eq(reports.status, "pending"))
.orderBy(desc(reports.createdAt))
.limit(100);
return (
<div className="space-y-6">
<div>
<h1 className="text-2xl font-bold tracking-tight">Reports</h1>
<p className="text-muted-foreground text-sm mt-1">
Content flagged by users. Dismiss if unfounded, or review and take action manually.
</p>
</div>
<ReportsQueue
reports={rows.map((r) => ({ ...r, createdAt: r.createdAt.toISOString() }))}
/>
</div>
);
}