import { getTranslations } from "next-intl/server"; import Link from "next/link"; import { ContentCard, EmptyState } from "@/components/public/ui"; import { prisma } from "@/lib/prisma"; import { siteSettings } from "@/lib/services/site-settings"; export const revalidate = 300; export const metadata = { title: "Staff" }; type StaffMember = { username: string; look: string; rank: number; motto: string; }; type Team = { id: string; rankName: string; badge: string | null; jobDescription: string | null; staffColor: string; }; export default async function StaffPage() { const t = await getTranslations("pages.staff"); const minStaffRank = Number(await siteSettings.get("min_staff_rank", "7")) || 7; let staff: StaffMember[] = []; try { staff = await prisma.user.findMany({ where: { rank: { gte: minStaffRank } }, select: { username: true, look: true, rank: true, motto: true }, orderBy: [{ rank: "desc" }, { username: "asc" }], take: 100, }); } catch { staff = []; } let teams: Team[] = []; try { const rows = await prisma.websiteTeams.findMany({ where: { hiddenRank: false }, select: { id: true, rankName: true, badge: true, jobDescription: true, staffColor: true, }, orderBy: { id: "asc" }, }); teams = rows.map((t) => ({ ...t, id: String(t.id) })); } catch { teams = []; } return (
{teams.length > 0 ? (
{teams.map((t) => (

{t.rankName}

{t.jobDescription ? (

{t.jobDescription}

) : null}
))}
) : null} {staff.length === 0 ? ( {t("emptyState")} ) : ( {staff.map((u) => ( ))}
{t("colUsername")} {t("colRank")} {t("colMotto")}
{u.username} {u.rank} {u.motto || "—"}
)}
); }