import { getTranslations } from "next-intl/server"; import Link from "next/link"; import Image from "next/image"; import { avatarImageUrl, excerpt } from "@/lib/format"; import { prisma } from "@/lib/prisma"; import { siteSettings } from "@/lib/services/site-settings"; import { HomeLoginForm } from "@/components/auth/home-login-form"; 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 (
{t("noArticles")}
) : ({excerpt(a.shortStory, 80)}
)}