import Image from "next/image"; import Link from "next/link"; import { getTranslations } from "next-intl/server"; import { HomeLoginForm } from "@/components/auth/home-login-form"; import { Reveal } from "@/components/motion-reveal"; import { avatarImageUrl, excerpt } from "@/lib/format"; import { prisma } from "@/lib/prisma"; import { siteSettings } from "@/lib/services/site-settings"; export default async function GuestView() { const t = await getTranslations("pages.home"); const _hotelName = await siteSettings.get("hotel_name", "Atom"); const imager = (await siteSettings.get( "habbo_imaging_url", "https://www.habbo.com/habbo-imaging/avatarimage", )) ?? ""; let articles: Array<{ slug: string; title: string; shortStory: string; image: string; }> = []; try { articles = await prisma.websiteArticles.findMany({ orderBy: { createdAt: "desc" }, take: 8, select: { slug: true, title: true, shortStory: true, image: true }, }); } catch {} let recentUsers: Array<{ username: string; look: string }> = []; try { recentUsers = await prisma.user.findMany({ orderBy: { lastOnline: "desc" }, take: 12, select: { username: true, look: true }, }); } catch {} return (
Register
REGISTER NOW
{recentUsers.length > 0 && (

Recent Users

{recentUsers.map((u) => (
{u.username}
))}
)}

{t("latestNews") || "Latest News"}

{articles.length === 0 ? (

{t("noArticles")}

) : (
{articles.map((a) => (
{a.title}

{a.title}

{a.shortStory && (

{excerpt(a.shortStory, 80)}

)}
))}
)}
); }