Files
medreport_mrb2b/app/home/(user)/(dashboard)/order-analysis/page.tsx
Helena 195af1db3d MED-137: add doctor other jobs view (#55)
* add doctor jobs view

* change translation

* another translation change

* clean up

* add analaysis detail view to paths config

* translation

* merge fix

* fix path

* move components to shared

* refactor

* imports

* clean up
2025-08-25 11:12:57 +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, PAGE_VIEW_ACTION } 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: PAGE_VIEW_ACTION.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);