diff --git a/src/app/insights/page.tsx b/src/app/insights/page.tsx index 4dea98fed..579b8cd30 100644 --- a/src/app/insights/page.tsx +++ b/src/app/insights/page.tsx @@ -29,12 +29,16 @@ import { ComplianceHeatmap } from "@/components/charts/compliance-heatmap"; import { Activity, Heart, + HeartPulse, Loader2, Percent, Pill, + Ruler, + Scale, Smile, TrendingUp, } from "lucide-react"; +import { InsightStatusCard } from "@/components/insights/insight-status-card"; import { ScatterChart, Scatter, @@ -525,7 +529,6 @@ export default function InsightsPage() { const { data: generalStatus, isLoading: isGeneralStatusLoading, - isError: isGeneralStatusError, } = useQuery({ queryKey: ["insights", "general-status", locale], queryFn: async () => { @@ -541,7 +544,6 @@ export default function InsightsPage() { const { data: bloodPressureStatus, isLoading: isBloodPressureStatusLoading, - isError: isBloodPressureStatusError, } = useQuery({ queryKey: ["insights", "blood-pressure-status", locale], queryFn: async () => { @@ -559,7 +561,6 @@ export default function InsightsPage() { const { data: weightStatus, isLoading: isWeightStatusLoading, - isError: isWeightStatusError, } = useQuery({ queryKey: ["insights", "weight-status", locale], queryFn: async () => { @@ -575,7 +576,6 @@ export default function InsightsPage() { const { data: pulseStatus, isLoading: isPulseStatusLoading, - isError: isPulseStatusError, } = useQuery({ queryKey: ["insights", "pulse-status", locale], queryFn: async () => { @@ -591,7 +591,6 @@ export default function InsightsPage() { const { data: bmiStatus, isLoading: isBmiStatusLoading, - isError: isBmiStatusError, } = useQuery({ queryKey: ["insights", "bmi-status", locale], queryFn: async () => { @@ -607,7 +606,6 @@ export default function InsightsPage() { const { data: moodStatus, isLoading: isMoodStatusLoading, - isError: isMoodStatusError, } = useQuery({ queryKey: ["insights", "mood-status", locale], queryFn: async () => { @@ -623,7 +621,6 @@ export default function InsightsPage() { const { data: medicationComplianceStatus, isLoading: isMedicationComplianceStatusLoading, - isError: isMedicationComplianceStatusError, } = useQuery({ queryKey: ["insights", "medication-compliance-status", locale], queryFn: async () => { @@ -929,27 +926,15 @@ export default function InsightsPage() { {t(`insights.generalStatusBadge.${overallStatus.level}`)} - {isGeneralStatusLoading ? ( -
- {t("insights.generalStatusLoading")} -
- ) : isGeneralStatusError ? ( -- {t("insights.generalStatusUnavailable")} -
- ) : generalStatus?.text ? ( -- {generalStatus.text} -
- ) : !generalStatus?.hasProvider ? ( -- {t("insights.generalStatusNoKey")} -
- ) : ( -- {generalStatus.text ?? t("insights.generalStatusUnavailable")} -
- )} +- {t("insights.bloodPressureStatusLoading")} -
- ) : isBloodPressureStatusError ? ( -- {t("insights.bloodPressureStatusUnavailable")} -
- ) : bloodPressureStatus?.text ? ( -- {bloodPressureStatus.text} -
- ) : !bloodPressureStatus?.hasProvider ? ( -- {t("insights.bloodPressureStatusNoKey")} -
- ) : ( -- {bloodPressureStatus.text ?? - t("insights.bloodPressureStatusUnavailable")} -
- )} -- {t("insights.weightStatusLoading")} -
- ) : isWeightStatusError ? ( -- {t("insights.weightStatusUnavailable")} -
- ) : weightStatus?.text ? ( -- {weightStatus.text} -
- ) : !weightStatus?.hasProvider ? ( -- {t("insights.weightStatusNoKey")} -
- ) : ( -- {weightStatus.text ?? t("insights.weightStatusUnavailable")} -
- )} -- {t("insights.pulseStatusLoading")} -
- ) : isPulseStatusError ? ( -- {t("insights.pulseStatusUnavailable")} -
- ) : pulseStatus?.text ? ( -- {pulseStatus.text} -
- ) : !pulseStatus?.hasProvider ? ( -- {t("insights.pulseStatusNoKey")} -
- ) : ( -- {pulseStatus.text ?? t("insights.pulseStatusUnavailable")} -
- )} -- {t("insights.moodStatusLoading")} -
- ) : isMoodStatusError ? ( -- {t("insights.moodStatusUnavailable")} -
- ) : moodStatus?.text ? ( -- {moodStatus.text} -
- ) : !moodStatus?.hasProvider ? ( -- {t("insights.moodStatusNoKey")} -
- ) : ( -- {moodStatus.text ?? t("insights.moodStatusUnavailable")} -
- )} -- {t("insights.medicationComplianceStatusLoading")} -
- ) : isMedicationComplianceStatusError ? ( -- {t("insights.medicationComplianceStatusUnavailable")} -
- ) : medicationComplianceStatus?.summary ? ( -- {medicationComplianceStatus.summary} -
- ) : !medicationComplianceStatus?.hasProvider ? ( -- {t("insights.medicationComplianceStatusNoKey")} -
- ) : ( -- {medicationComplianceStatus.summary ?? - t("insights.medicationComplianceStatusUnavailable")} -
- )} -{t("common.noData")}
)} -- {t("insights.bmiStatusLoading")} -
- ) : isBmiStatusError ? ( -- {t("insights.bmiStatusUnavailable")} -
- ) : bmiStatus?.text ? ( -- {bmiStatus.text} -
- ) : !bmiStatus?.hasProvider ? ( -- {t("insights.bmiStatusNoKey")} -
- ) : ( -- {bmiStatus.text ?? t("insights.bmiStatusUnavailable")} -
- )} -