import { createBan, liftBan } from "@/actions/admin-bans"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; export default async function AdminBans() { const now = Math.floor(Date.now() / 1000); let bans: Awaited> = []; try { bans = await prisma.ban.findMany({ where: { banExpire: { gt: now } }, orderBy: { timestamp: "desc" }, take: 100, }); } catch { bans = []; } return (

Bans

New ban

{bans.map((b) => ( ))}
User ID Type Reason Expires
{b.userId} {b.type} {b.banReason} {new Date(b.banExpire * 1000).toISOString().slice(0, 16).replace("T", " ")}
{bans.length === 0 ?

No active bans.

: null}
); }