Merge branch 'develop' into feature/MED-129
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import { toTitleCase } from '@/lib/utils';
|
||||
@@ -5,12 +7,15 @@ import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-
|
||||
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
import { createUserAnalysesApi } from '@kit/user-analyses/api';
|
||||
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import Dashboard from '../_components/dashboard';
|
||||
import DashboardCards from '../_components/dashboard-cards';
|
||||
import Recommendations from '../_components/recommendations';
|
||||
import RecommendationsSkeleton from '../_components/recommendations-skeleton';
|
||||
import { loadCurrentUserAccount } from '../_lib/server/load-user-account';
|
||||
import { createUserAnalysesApi } from '@/packages/features/user-analyses/src/server/api';
|
||||
|
||||
@@ -48,6 +53,17 @@ async function UserHomePage() {
|
||||
/>
|
||||
<PageBody>
|
||||
<Dashboard account={account} bmiThresholds={bmiThresholds} />
|
||||
{process.env.OPENAI_API_KEY &&
|
||||
process.env.PROMPT_ID_ANALYSIS_RECOMMENDATIONS && (
|
||||
<>
|
||||
<h4>
|
||||
<Trans i18nKey="dashboard:recommendations.title" />
|
||||
</h4>
|
||||
<Suspense fallback={<RecommendationsSkeleton />}>
|
||||
<Recommendations account={account} />
|
||||
</Suspense>
|
||||
</>
|
||||
)}
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user