import { setRequestLocale } from 'next-intl/server';
import type { Metadata } from 'next';
import DashboardContent from '@/components/auth/DashboardContent';

type Props = {
  params: Promise<{ locale: string }>;
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { locale } = await params;

  const titles: Record<string, string> = {
    de: 'Dashboard | Damjan Savić',
    en: 'Dashboard | Damjan Savić',
    sr: 'Dashboard | Damjan Savić',
  };

  return {
    title: titles[locale] || titles.de,
    robots: {
      index: false,
      follow: false,
      googleBot: {
        index: false,
        follow: false,
      },
    },
  };
}

export default async function DashboardPage({ params }: Props) {
  const { locale } = await params;
  setRequestLocale(locale);

  return <DashboardContent />;
}
