import { Metadata } from 'next';
import { getTranslations } from 'next-intl/server';
import { OrgChartContent } from './org-chart-content';

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

  return {
    title: t('orgChart.title'),
    description: t('orgChart.description'),
  };
}

export default async function OrgChartPage({
  params,
}: {
  params: Promise<{ locale: string }>;
}) {
  const { locale } = await params;
  return <OrgChartContent locale={locale} />;
}
