/* global React */
const { useState, useEffect, useRef, useMemo } = React;
// ────────────────────────────────────────────────────────────
// Базовые UI-примитивы
// ────────────────────────────────────────────────────────────
window.MonoType = ({ children, style }) => (
{children}
);
window.Divider = ({ T }) => (
);
// Пульсирующая «живая» точка — статус мониторинга
window.LivePulse = ({ color = "#4F6B3A", size = 8 }) => (
);
// Бэйдж магнитуды — крупный, монохромный, «приборный»
window.MagBadge = ({ mag, T, size = 56 }) => {
const color = window.magColor(mag, T);
return (
);
};
// Статичная мини-карта с пином (SVG, не Leaflet — для производительности списка)
window.MiniMap = ({ lat, lon, T, w = 80, h = 60, mag = 4 }) => {
// Простейшая проекция окна Россия+СНГ → SVG
const x = ((lon + 180) / 360) * w;
const y = (1 - (lat + 90) / 180) * h;
const color = window.magColor(mag, T);
return (
);
};
// «Сейсмограф» — декоративная wave-линия (SVG)
window.SeismoLine = ({ T, w = 380, h = 32, seed = 1, intense = 0.6 }) => {
const pts = [];
let prng = seed;
for (let i = 0; i <= 80; i++) {
prng = (prng * 9301 + 49297) % 233280;
const r = prng / 233280;
const x = (i / 80) * w;
let amp = (r - 0.5) * 4;
// всплеск посередине
const k = Math.exp(-Math.pow((i - 40) / 8, 2)) * 14 * intense;
amp += (r - 0.5) * k;
const y = h / 2 + amp;
pts.push(`${x.toFixed(1)},${y.toFixed(1)}`);
}
return (
);
};
// Кнопка-tab нижней навигации
window.TabButton = ({ icon, label, active, onClick, T }) => (
);
// Header — общий для экранов
window.ScreenHeader = ({ title, onBack, right, T, subtitle }) => (
{onBack && (
)}
{title}
{subtitle &&
{subtitle}
}
{right}
);
// Иконки (тонкие, scientific-style; собственная отрисовка простыми путями)
window.Icon = {
pulse: (s = 18) => (
),
map: (s = 18) => (
),
chart: (s = 18) => (
),
bell: (s = 18) => (
),
settings: (s = 18) => (
),
info: (s = 18) => (
),
layers: (s = 18) => (
),
};
Object.assign(window, {});