import { DashboardAnnouncements } from '@/features/overview/components/dashboard-announcements';
import { TopCoursesChart } from '@/features/overview/components/top-courses-chart';
import { getOverviewDashboardData } from '@/features/overview/server/overview-data';

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

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

  return <DashboardAnnouncements items={data.employee.announcements} />;
}
