"use client"; import { useI18n } from "@/lib/i18n/useI18n"; type Props = { moldChangeStartMs: number | null; offlineForMin: number | null; ongoingStopMin: number | null; }; function toInt(value: number | null | undefined) { if (value == null || Number.isNaN(value)) return 0; return Math.max(0, Math.round(value)); } export default function RecapBanners({ moldChangeStartMs, offlineForMin, ongoingStopMin }: Props) { const { t, locale } = useI18n(); const moldStartLabel = moldChangeStartMs ? new Date(moldChangeStartMs).toLocaleTimeString(locale, { hour: "2-digit", minute: "2-digit" }) : "--:--"; const showOffline = offlineForMin != null && offlineForMin > 10; const hideMoldBecauseOffline = showOffline && moldChangeStartMs != null; return (