import { getTranslations } from "next-intl/server"; import { formatDate } from "@/lib/format-date"; import { deleteShout } from "@/actions/admin-radio-moderation"; import { StatusCard } from "@/components/admin/dashboard"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; type Shout = { id: bigint; userId: bigint; message: string; createdAt: Date | null; updatedAt: Date | null; }; export default async function AdminRadioModerationPage() { const t = await getTranslations("pages.admin.radio"); let shouts: Shout[] = []; try { shouts = await prisma.radioShouts.findMany({ select: { id: true, userId: true, message: true, createdAt: true, updatedAt: true, }, orderBy: { id: "desc" }, take: 50, }); } catch { shouts = []; } return (

{t("moderationPage.recentShouts", { count: shouts.length })}

{shouts.length === 0 ? (
{t("noShouts")}
) : ( {shouts.map((s) => ( ))}
ID {t("user")} {t("message")} {t("posted")}
{String(s.id)} {String(s.userId)} {s.message} {formatDate(s.createdAt, "datetime", "\u2014")}
)}
); }