import { redirect } from "next/navigation"; import { headers } from "next/headers"; import Link from "next/link"; import { auth } from "@/lib/auth/server"; import { getMessages } from "@/lib/i18n/server"; import { getEffectiveMarketingLocale } from "@/lib/marketing-locale"; import { isSignupsDisabled } from "@/lib/site-settings"; import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { Sparkles, Calendar, Package, MessageCircle, Users, ChefHat, Utensils, Wand2 } from "lucide-react"; const HIGHLIGHTS = [ { icon: Sparkles, key: "ai" }, { icon: MessageCircle, key: "assistant" }, { icon: Calendar, key: "mealPlan" }, { icon: Package, key: "pantry" }, { icon: Utensils, key: "cookMode" }, { icon: Wand2, key: "variations" }, { icon: Users, key: "social" }, { icon: ChefHat, key: "batchCook" }, ] as const; export default async function MarketingHomePage() { const session = await auth.api.getSession({ headers: await headers() }); if (session) redirect("/recipes"); const [locale, signupsDisabled] = await Promise.all([getEffectiveMarketingLocale(), isSignupsDisabled()]); const m = getMessages(locale); const t = m.marketing.home; const ctaLabel = signupsDisabled ? m.marketing.nav.signupClosed : t.ctaPrimary; return (

{t.heroTitle}

{t.heroSubtitle}

{ctaLabel} {t.ctaSecondary}
{HIGHLIGHTS.map(({ icon: Icon, key }) => (

{t.highlights[key].title}

{t.highlights[key].description}

))}

{t.bottomCtaTitle}

{t.bottomCtaSubtitle}

{ctaLabel}
); }