import { Metadata } from 'next';
import { getTranslations } from 'next-intl/server';
import { EmployeeDetailContent } from './employee-detail-content';

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string; id: string }>;
}): Promise<Metadata> {
  const { locale } = await params;
  const t = await getTranslations({ locale, namespace: 'hr' });

  return {
    title: t('employees.details'),
    description: t('employees.detailsDescription'),
  };
}

export default async function EmployeeDetailPage({
  params,
}: {
  params: Promise<{ locale: string; id: string }>;
}) {
  const { locale, id } = await params;
  return <EmployeeDetailContent locale={locale} employeeId={id} />;
}
