import { PageBody, PageHeader } from '@kit/ui/page';

import {
  DoctorPageViewAction,
  createDoctorPageViewLog,
} from '~/lib/services/audit/doctorPageView.service';

import Dashboard from './_components/doctor-dashboard';
import { DoctorGuard } from './_components/doctor-guard';

async function DoctorPage() {
  await createDoctorPageViewLog({
    action: DoctorPageViewAction.VIEW_DASHBOARD,
  });

  return (
    <>
      <PageHeader />
      <PageBody>
        <Dashboard />
      </PageBody>
    </>
  );
}

export default DoctorGuard(DoctorPage);
