import { AreaGraph } from '@/features/overview/components/area-graph';
import { KsaProgress } from '@/features/overview/components/ksa-progress';
import { getOverviewDashboardData } from '@/features/overview/server/overview-data';

export default async function AreaStats() {
  const data = await getOverviewDashboardData();

  if (data.role === 'owner' || data.role === 'admin') {
    return <AreaGraph data={data.hrd.monthlyTrend} />;
  }

  return <KsaProgress items={data.employee.ksaProgress} />;
}
