add real data to ai
This commit is contained in:
@@ -4,10 +4,11 @@ import React from 'react';
|
||||
|
||||
import { AccountWithParams } from '@/packages/features/accounts/src/types/accounts';
|
||||
|
||||
import { analysisResponses } from '../(dashboard)/analysis-results/test/test-responses';
|
||||
import { Trans } from '@kit/ui/makerkit/trans';
|
||||
|
||||
import { loadAnalyses } from '../_lib/server/load-analyses';
|
||||
import { loadRecommendations } from '../_lib/server/load-recommendations';
|
||||
import OrderAnalysesCards, { OrderAnalysisCard } from './order-analyses-cards';
|
||||
import OrderAnalysesCards from './order-analyses-cards';
|
||||
|
||||
export default async function Recommendations({
|
||||
account,
|
||||
@@ -15,25 +16,21 @@ export default async function Recommendations({
|
||||
account: AccountWithParams;
|
||||
}) {
|
||||
const { analyses, countryCode } = await loadAnalyses();
|
||||
const analysisResults = analysisResponses;
|
||||
|
||||
const analysisRecommendations = await loadRecommendations(
|
||||
analysisResults,
|
||||
analyses,
|
||||
account,
|
||||
);
|
||||
|
||||
const analysisRecommendations = await loadRecommendations(analyses, account);
|
||||
const orderAnalyses = analyses.filter((analysis) =>
|
||||
analysisRecommendations.includes(analysis.title),
|
||||
);
|
||||
console.log('analysisRecommendations', analysisRecommendations);
|
||||
|
||||
if (orderAnalyses.length < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h4>Medreport soovitab teile</h4>
|
||||
<h4>
|
||||
<Trans i18nKey="dashboard:recommendations.title" />
|
||||
</h4>
|
||||
<OrderAnalysesCards analyses={orderAnalyses} countryCode={countryCode} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user