import type { DispersionGridResult, WeatherFetchResult } from '../utils/dispersionTypes';
import { windDirToCompass } from '../hooks/useWeatherFetch';
interface HNSRightPanelProps {
dispersionResult: {
zones: Array<{
level: string;
color: string;
radius: number;
angle: number;
}>;
timestamp: string;
windDirection: number;
substance: string;
concentration: {
'AEGL-3': string;
'AEGL-2': string;
'AEGL-1': string;
};
} | null;
computedResult?: DispersionGridResult | null;
weatherData?: WeatherFetchResult | null;
onOpenRecalc?: () => void;
onOpenReport?: () => void;
onSave?: () => void;
}
export function HNSRightPanel({
dispersionResult,
computedResult,
weatherData,
onOpenRecalc,
onOpenReport,
onSave,
}: HNSRightPanelProps) {
if (!dispersionResult) {
return (
๐
์์ธก ์คํ ํ ๊ฒฐ๊ณผ๊ฐ ํ์๋ฉ๋๋ค
);
}
const area = computedResult?.aeglAreas.aegl1 ?? 0;
const maxConc = computedResult?.maxConcentration ?? 0;
const windSpd = weatherData?.windSpeed ?? 5.0;
const windDir = weatherData?.windDirection ?? dispersionResult.windDirection;
const modelLabel =
computedResult?.modelType === 'plume'
? 'Gaussian Plume'
: computedResult?.modelType === 'puff'
? 'Gaussian Puff'
: computedResult?.modelType === 'dense_gas'
? 'Dense Gas (B-M)'
: 'ALOHA';
return (
{/* Header */}
{dispersionResult.substance} ยท {modelLabel}
{/* KPI Cards */}
{/* ์ต๋ ๋๋ */}
์ต๋ ๋๋
{maxConc > 0 ? maxConc.toFixed(1) : 'โ'}{' '}
ppm
{/* ํ์ฐ ๋ฉด์ */}
AEGL-1 ํ์ฐ ๋ฉด์
{area > 0 ? area.toFixed(2) : 'โ'} kmยฒ
{/* ํ์ */}
ํ์
{windSpd.toFixed(1)} m/s
{/* ํํฅ */}
ํํฅ
{windDirToCompass(windDir)} {windDir}ยฐ
{/* AEGL Zone Details */}
AEGL ๊ตฌ์ญ ์์ธ
{/* AEGL-3 */}
AEGL-3 (์๋ช
์ํ)
{computedResult?.aeglDistances.aegl3 || 0}m
{dispersionResult.concentration['AEGL-3']}
{computedResult?.aeglAreas.aegl3 ?? 0} kmยฒ
{/* AEGL-2 */}
AEGL-2 (๊ฑด๊ฐํผํด)
{computedResult?.aeglDistances.aegl2 || 0}m
{dispersionResult.concentration['AEGL-2']}
{computedResult?.aeglAreas.aegl2 ?? 0} kmยฒ
{/* AEGL-1 */}
AEGL-1 (๋ถ์พ๊ฐ)
{computedResult?.aeglDistances.aegl1 || 0}m
{dispersionResult.concentration['AEGL-1']}
{computedResult?.aeglAreas.aegl1 ?? 0} kmยฒ
{/* ์๊ฐ ์ ๋ณด (puff/dense_gas) */}
{computedResult && computedResult.modelType !== 'plume' && (
ํ์ฌ ์๋ฎฌ๋ ์ด์
์๊ฐ
t = {computedResult.timeStep}s
({(computedResult.timeStep / 60).toFixed(1)}๋ถ)
)}
{/* Timestamp */}
์์ธก ์๊ฐ: {new Date(dispersionResult.timestamp).toLocaleString('ko-KR')}
{/* Bottom Action Buttons */}
);
}