import { headers } from "next/headers"; import Image from "next/image"; import Link from "next/link"; import { getTranslations } from "next-intl/server"; import { RegisterForm } from "@/components/auth/register-form"; import { cached } from "@/lib/cache"; import { avatarImageUrl } from "@/lib/format"; import { prisma } from "@/lib/prisma"; import { captchaConfig } from "@/lib/services/captcha"; import { resolveHotelName } from "@/lib/hotel-name"; import { siteSettings } from "@/lib/services/site-settings"; export default async function RegisterPage() { const th = await getTranslations("header"); const tpr = await getTranslations("pages.register"); const [hotelName, imagerRaw, cfg] = await Promise.all([ resolveHotelName(), siteSettings.get( "habbo_imaging_url", "https://www.habbo.com/habbo-imaging/avatarimage", ), captchaConfig(), ]); const imager = imagerRaw ?? "https://www.habbo.com/habbo-imaging/avatarimage"; const nonce = (await headers()).get("x-nonce") ?? undefined; const [online, recentUsers] = await Promise.all([ cached("online_count", 10_000, () => prisma.user.count({ where: { online: "1" } }), ).catch(() => 0), prisma.user .findMany({ where: { online: "1" }, select: { username: true, look: true }, take: 8, }) .catch(() => []), ]); return (
{th("tagline")}
{tpr("alreadyHaveAccountPre")}{" "} {tpr("alreadyHaveAccountLink")}
{tpr("subtitle")}