import { useDashboardRole } from '../../hooks/useDashboardRole';
import { DoctorDashboard } from './StatisticsDashboard/DoctorDashboard';
import { NurseDashboard } from './StatisticsDashboard/NurseDashboard';
import { AdminDashboard } from './StatisticsDashboard/AdminDashboard';
import { OperatorDashboard } from './StatisticsDashboard/OperatorDashboard';

const DASHBOARD_MAP = {
  doctor: DoctorDashboard,
  nurse: NurseDashboard,
  admin: AdminDashboard,
  operator: OperatorDashboard,
} as const;

export default function StatisticsDashboard() {
  const role = useDashboardRole();
  const DashboardComponent = DASHBOARD_MAP[role];
  return <DashboardComponent />;
}
