import type { Metadata } from "next";
import { headers } from "next/headers";
import { auth } from "@/lib/auth/server";
import { NutritionDiary } from "@/components/nutrition/nutrition-diary";
import { getMessages } from "@/lib/i18n/server";

export const metadata: Metadata = {};

export default async function NutritionDiaryPage() {
  const session = await auth.api.getSession({ headers: await headers() });
  if (!session) return null;
  const m = getMessages((session.user as { locale?: string }).locale);

  return (
    <div className="space-y-8">
      <div>
        <h1 className="text-2xl font-bold tracking-tight">{m.nutritionDiary.title}</h1>
        <p className="text-muted-foreground mt-1">{m.nutritionDiary.subtitle}</p>
      </div>
      <NutritionDiary />
    </div>
  );
}
