diff --git a/components/AiInsightCard.tsx b/components/AiInsightCard.tsx index 270fa0c..6d04c02 100644 --- a/components/AiInsightCard.tsx +++ b/components/AiInsightCard.tsx @@ -265,6 +265,7 @@ export const AiInsightCard: React.FC = ({ const [reportType, setReportType] = useState('daily'); const [dayPeriod, setDayPeriod] = useState(null); const [isCollapsed, setIsCollapsed] = useState(false); + const cardRef = useRef(null); const insightInFlightRef = useRef(false); const effectiveKandangId = kandangId ?? selectedKandangId; @@ -782,7 +783,10 @@ export const AiInsightCard: React.FC = ({ }; return ( -
+
= ({ )}
- {lastUpdated && ( -
-

Terakhir diperbarui: {formatLastUpdated()}

-
- )} +
+ + {lastUpdated && ( +

+ Terakhir diperbarui: {formatLastUpdated()} +

+ )} +
)}
diff --git a/components/shared/PageAiInsight.tsx b/components/shared/PageAiInsight.tsx index 320674e..1835e66 100644 --- a/components/shared/PageAiInsight.tsx +++ b/components/shared/PageAiInsight.tsx @@ -239,6 +239,7 @@ export const PageAiInsight: React.FC = ({ const lastCacheKeyRef = useRef(null); const desiredKeyRef = useRef(''); const requestIdRef = useRef(0); + const cardRef = useRef(null); const generateRef = useRef<(force?: boolean) => Promise>(async () => {}); const chartHighlight = React.useMemo(() => { @@ -674,7 +675,10 @@ export const PageAiInsight: React.FC = ({ }, [scopeKey]); return ( -
+
= ({
)} + +
+ +
)}