diff --git a/src/app/apply/staff/page.tsx b/src/app/apply/staff/page.tsx index f1efe8f6..045bc884 100644 --- a/src/app/apply/staff/page.tsx +++ b/src/app/apply/staff/page.tsx @@ -1,3 +1,4 @@ +import { getTranslations } from "next-intl/server"; import { redirect } from "next/navigation"; import { applyStaff } from "@/actions/applications"; import { ContentCard, EmptyState } from "@/components/public/ui"; @@ -10,18 +11,20 @@ export const dynamic = "force-dynamic"; // Canonical Habbo badge image CDN (same base used by the profile page). const BADGE_IMG_BASE = "https://images.habbo.com/c_images/album1584"; -function formatDeadline(d: Date | null | undefined): string { - if (!d) return "No deadline set"; - return d.toISOString().slice(0, 16).replace("T", " "); -} - export default async function ApplyStaffPage() { const session = await auth(); if (!session?.user?.id) redirect("/login"); + const t = await getTranslations("pages.applyStaff"); + const userId = Number(session.user.id); const hotelName = (await siteSettings.get("hotel_name", "Atom")) ?? "Atom"; + function formatDeadline(d: Date | null | undefined): string { + if (!d) return t("noDeadline"); + return d.toISOString().slice(0, 16).replace("T", " "); + } + // ── Open positions ────────────────────────────────────────── // Each query is isolated so a DB hiccup degrades that section to empty // rather than 500-ing the whole page. @@ -52,16 +55,13 @@ export default async function ApplyStaffPage() {
{positions.length === 0 ? ( - - - There are currently no positions open. Please come back at a later time to check if we - have any openings by then. Thank you for your interest. - + + {t("noPositionsBody")} ) : (
@@ -98,7 +98,7 @@ export default async function ApplyStaffPage() {

{position.description}

- Application deadline: {formatDeadline(position.applyTo)} + {t("deadline", { date: formatDeadline(position.applyTo) })}

{alreadyApplied ? ( @@ -108,7 +108,7 @@ export default async function ApplyStaffPage() { disabled style={{ width: "100%" }} > - You have already applied for {rankName} + {t("alreadyApplied", { rank: rankName })} ) : (
@@ -116,7 +116,7 @@ export default async function ApplyStaffPage() { re-read from the session inside the action. */}