We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43e0291 commit 58c8364Copy full SHA for 58c8364
src/pages/PredictiveAnalytics.jsx
@@ -55,10 +55,11 @@ export default function PredictiveAnalytics() {
55
);
56
}
57
58
- const churnInsights = insights.filter(i => i.insight_type === 'churn_risk');
+ const churnInsights = safeInsights.filter(i => i.insight_type === 'churn_risk');
59
const highRisk = churnInsights.filter(i => i.risk_score >= 70);
60
const mediumRisk = churnInsights.filter(i => i.risk_score >= 40 && i.risk_score < 70);
61
const lowRisk = churnInsights.filter(i => i.risk_score < 40);
62
+ const hasInsights = safeInsights.length > 0;
63
64
return (
65
<div className="space-y-6">
0 commit comments