"use client"; import { cn } from "@/lib/utils"; import { useTranslations } from "@/lib/i18n/context"; import type { CorrelationResult } from "@/lib/insights/correlations"; import { CorrelationCard } from "./correlation-card"; /** * v1.4.20 phase B3 — Correlation row. * * Renders the pre-defined hypothesis cards in a 2-up grid on `>=md` and * a single column on `` painted an EmptyState for below- * threshold results, which left half-rows of greyed-out placeholders * on a sparse account. */ interface CorrelationRowProps { results: { bpCompliance: CorrelationResult; moodPulse: CorrelationResult; weightWeekday: CorrelationResult; }; } export function CorrelationRow({ results }: CorrelationRowProps) { const { t } = useTranslations(); // Drop insufficient-data tiles up-front. The grid below picks 1-col vs // 2-col automatically so 1 ok card spans 100 % width on its own row. const okResults = [ results.bpCompliance, results.moodPulse, results.weightWeekday, ].filter((r) => r.status === "ok"); if (okResults.length === 0) return null; return (

{t("insights.correlationRow.title")}

{t("insights.correlationRow.subtitle")}

1 && "md:grid-cols-2", )} > {okResults.map((result) => ( ))}

{t("insights.correlationRow.disclaimer")}

); }