Files
medreport_mrb2b/app/home/(user)/(dashboard)/order-analysis/page.tsx
Helena 8c6ce29c23 MED-147: add doctor actions logging (#59)
* MED-147: add doctor actions logging

* enum casing
2025-08-27 08:11:13 +03:00

47 lines
1.4 KiB
TypeScript

import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
import { PageBody } from '@kit/ui/page';
import { Trans } from '@kit/ui/trans';
import { HomeLayoutPageHeader } from '../../_components/home-page-header';
import { loadAnalyses } from '../../_lib/server/load-analyses';
import OrderAnalysesCards from '../../_components/order-analyses-cards';
import { createPageViewLog, PageViewAction } from '~/lib/services/audit/pageView.service';
import { loadCurrentUserAccount } from '../../_lib/server/load-user-account';
export const generateMetadata = async () => {
const { t } = await createI18nServerInstance();
return {
title: t('order-analysis:title'),
};
};
async function OrderAnalysisPage() {
const account = await loadCurrentUserAccount();
if (!account) {
throw new Error('Account not found');
}
const { analyses, countryCode } = await loadAnalyses();
await createPageViewLog({
accountId: account.id,
action: PageViewAction.VIEW_ORDER_ANALYSIS,
});
return (
<>
<HomeLayoutPageHeader
title={<Trans i18nKey={'order-analysis:title'} />}
description={<Trans i18nKey={'order-analysis:description'} />}
/>
<PageBody>
<OrderAnalysesCards analyses={analyses} countryCode={countryCode} />
</PageBody>
</>
);
}
export default withI18n(OrderAnalysisPage);