/* global React */ // ──────────────────────────────────────────────────────────── // AFTERSHOCKS — таймлайн повторных толчков для основного события. // Радиус 50км, окно 72ч после основного. // Используется как inline-секция в EventDetailScreen для M ≥ 5.0. // ──────────────────────────────────────────────────────────── window.AftershockSection = ({ T, dark, mainEvent }) => { const [aftershocks, setAftershocks] = React.useState(null); // null = loading, [] = none const [error, setError] = React.useState(null); React.useEffect(() => { if (!mainEvent) return; let cancelled = false; window.DATA.fetchAftershocks(mainEvent, { radiusKm: 50, windowHours: 72 }) .then((rows) => { if (!cancelled) setAftershocks(rows); }) .catch((e) => { if (!cancelled) setError(String(e)); }); return () => { cancelled = true; }; }, [mainEvent && mainEvent.id]); if (error) return null; // silent fail — don't break detail screen if (aftershocks === null) { return (