import Image from "next/image" import { notFound } from "next/navigation" import { cookies } from "next/headers" import Link from "next/link" import { ChevronLeft } from "lucide-react" import prisma from "@/lib/prisma" import { Button } from "@/components/ui/button" import { PlanLoginForm } from "@/components/plan-login-form" import { PlanDashboard } from "./_components/plan-dashboard" import { getDictionary } from "@/get-dictionary" export default async function DashboardPage({ params }: { params: Promise<{ planId: string, lang: string }> }) { const { planId, lang } = await params const dict = await getDictionary(lang as any) const plan = await prisma.plan.findUnique({ where: { id: planId }, include: { bookings: true }, }) if (!plan) { notFound() } const cookieStore = await cookies() const isAuthenticated = cookieStore.get(`plan_auth_${plan.id}`)?.value === "true" if (!isAuthenticated) { return (
) } return (
Logo

{plan.title}

{plan.startDate.toLocaleDateString(lang)} - {plan.endDate.toLocaleDateString(lang)}

Plan ID: {plan.id}
) }