diff --git a/components/AiInsightCard.tsx b/components/AiInsightCard.tsx index 2a88bbc..b63186c 100644 --- a/components/AiInsightCard.tsx +++ b/components/AiInsightCard.tsx @@ -663,6 +663,41 @@ export const AiInsightCard: React.FC = ({ ]); const renderVisualBlock = () => { + if (loading) { + if (page !== 'dashboard') return null; + return ( +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ); + } + if (!hasInsight || !scopedMetrics || page !== 'dashboard') return null; const fcrVal = scopedMetrics.fcr; @@ -830,7 +865,12 @@ export const AiInsightCard: React.FC = ({

AI Insight

- {hasInsight && ( + {loading ? ( + + + Memproses... + + ) : hasInsight ? ( = ({ : undefined } /> - )} + ) : null}

{selectedKandang?.kandang_name ?? `Kandang ${effectiveKandangId}`} @@ -909,16 +949,21 @@ export const AiInsightCard: React.FC = ({ Pilih satu kandang untuk menghasilkan AI Insight. Generate untuk semua kandang tidak diizinkan.

- ) : loading && !insightText ? ( -
+ ) : loading ? ( +
-
-

- Menganalisis data peternakan… proses ini bisa memakan waktu beberapa menit. -

+
+
+

+ Menganalisis data peternakan & menyusun insight… +

+

+ Proses kalkulasi CP 707 dan AI sedang berjalan. Mohon tunggu beberapa saat. +

+
- ) : error && !insightText ? ( + ) : error ? (

Error

{error}

@@ -1179,12 +1224,17 @@ export const AiInsightCard: React.FC = ({
- {hasInsight && ( + {loading ? ( + + + Sedang memperbarui analisis AI... + + ) : hasInsight ? ( Status AI Insight: - )} + ) : null}