update ai insight root cause
This commit is contained in:
1 parent
7e8c06d36f
commit
15ebdcce78
7 files changed
+297
-48
No files matched your search
@@ -522,10 +522,11 @@ export const PageAiInsight: React.FC<PageAiInsightProps> = ({
|
||||
}
|
||||
|
||||
const text = apiResult.insight_text ?? '';
|
||||
let parsed: { summary: string; insight: string } | null = null;
|
||||
if (apiResult.summary || apiResult.insight) {
|
||||
let parsed: AiResult | null = null;
|
||||
if (apiResult.summary || apiResult.insight || apiResult.akar_masalah) {
|
||||
parsed = {
|
||||
summary: apiResult.summary || '',
|
||||
akar_masalah: apiResult.akar_masalah || undefined,
|
||||
insight: apiResult.insight || apiResult.insight_text || '',
|
||||
};
|
||||
} else {
|
||||
@@ -538,6 +539,7 @@ export const PageAiInsight: React.FC<PageAiInsightProps> = ({
|
||||
|
||||
const wrapped: PageInsightResult = {
|
||||
summary: parsed.summary,
|
||||
akar_masalah: parsed.akar_masalah,
|
||||
insight: parsed.insight,
|
||||
citations: apiResult.citations,
|
||||
};
|
||||
@@ -939,9 +941,20 @@ export const PageAiInsight: React.FC<PageAiInsightProps> = ({
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{result.akar_masalah && (
|
||||
<div className="mt-4">
|
||||
<h4 className="text-sm font-bold text-gray-800 mb-2 flex items-center gap-2">
|
||||
<i className="fa-solid fa-magnifying-glass-chart text-amber-600" /> Akar Masalah
|
||||
</h4>
|
||||
<p className="text-sm text-gray-700 bg-amber-50/50 p-3 rounded-lg border border-amber-100/80">
|
||||
{result.akar_masalah}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="mt-4">
|
||||
<h4 className="text-sm font-bold text-gray-800 mb-2 flex items-center gap-2">
|
||||
<i className="fa-solid fa-brain text-red-600" /> AI Insight
|
||||
<i className="fa-solid fa-brain text-red-600" /> AI Insight & Rekomendasi
|
||||
</h4>
|
||||
<p className="text-sm text-gray-700 bg-gray-50 p-3 rounded-lg border border-gray-100 whitespace-pre-wrap">
|
||||
{result.insight}
|
||||
|
||||
Reference in new issue
Block a user