import { auth } from "@/lib/auth"; import { avatarImageUrl } from "@/lib/format"; import { prisma } from "@/lib/prisma"; import { siteSettings } from "@/lib/services/site-settings"; import { postShout } from "@/actions/radio-shouts"; export const dynamic = "force-dynamic"; function formatDate(d: Date | null | undefined): string { return d ? d.toISOString().slice(0, 16).replace("T", " ") : ""; } export default async function RadioShoutsPage() { const [shouts, imagerBase, session] = await Promise.all([ prisma.radioShouts .findMany({ orderBy: { createdAt: "desc" }, take: 50, }) .catch(() => []), siteSettings.get( "habbo_imaging_url", "https://www.habbo.com/habbo-imaging/avatarimage", ), auth(), ]); const isLoggedIn = Boolean(session?.user?.id); // Resolve author usernames/looks. shout.userId is BigInt; User.id is Int. const authorIds = Array.from(new Set(shouts.map((s) => Number(s.userId)))); const authors = authorIds.length ? await prisma.user .findMany({ where: { id: { in: authorIds } }, select: { id: true, username: true, look: true }, }) .catch(() => []) : []; const authorById = new Map(authors.map((a) => [a.id, a])); return (

Radio Shouts

Shout-outs and requests from the community.

{isLoggedIn ? (
{/* The author is taken from the session inside the action, never from this form — no user id is submitted. */}