import React from 'react'; import type { CellInfo } from '@/components/AlertMap'; import { HORIZON_LABELS } from './types'; import type { ExtendedAlert } from './types'; interface CellInfoPanelProps { cellInfo: CellInfo; onClose: () => void; } // Cell info panel - shown when clicking grid cell without alert export const CellInfoPanel = React.memo(function CellInfoPanel({ cellInfo, onClose }: CellInfoPanelProps) { return (
网格详情 (100m)
网格 {cellInfo.grid_id}
坐标 {cellInfo.lat.toFixed(4)}, {cellInfo.lon.toFixed(4)}
当前风险 = 0.8 ? 'text-danger' : cellInfo.risk >= 0.6 ? 'text-warning' : cellInfo.risk >= 0.4 ? 'text-primary' : 'text-success'}`}> {(cellInfo.risk * 100).toFixed(1)}%
1天
{(cellInfo.risk_1d * 100).toFixed(0)}%
3天
{(cellInfo.risk_3d * 100).toFixed(0)}%
7天
{(cellInfo.risk_7d * 100).toFixed(0)}%
{cellInfo.nearestAlertId && (
最近预警距离 {(cellInfo.nearestAlertDist * 111).toFixed(1)} km
)} {!cellInfo.nearestAlertId && (
该区域无预警
)}
); }); interface AlertDetailModalProps { alert: ExtendedAlert; onClose: () => void; } // Alert detail modal export const AlertDetailModal = React.memo(function AlertDetailModal({ alert, onClose }: AlertDetailModalProps) { return (
e.stopPropagation()}>

预警详情

优先级 {alert.priority}
风险值 {Math.round(alert.risk_value * 100)}%
预测时效 {HORIZON_LABELS[alert.forecast_horizon]}
位置 {alert.region}
预警原因
{alert.reason}
); });