interface WeatherData { stationName: string; location: { lat: number; lon: number }; currentTime: string; wind: { speed: number; direction: number; directionLabel: string; speed_1k: number; speed_3k: number; }; wave: { height: number; maxHeight: number; period: number; direction: string; }; temperature: { current: number; feelsLike: number; }; pressure: number; visibility: number; salinity: number; astronomy?: { sunrise: string; sunset: string; moonrise: string; moonset: string; moonPhase: string; tidalRange: number; }; alert?: string; forecast: WeatherForecast[]; } interface WeatherForecast { time: string; hour: string; icon: string; temperature: number; windSpeed: number; } interface WeatherRightPanelProps { weatherData: WeatherData | null; } /* ── Local Helpers (not exported) ─────────────────────────── */ function WindCompass({ degrees }: { degrees: number }) { // center=28, radius=22 return ( {/* arcs connecting N→E→S→W→N */} {/* cardinal labels — same color as 풍향/기압 text (#edf0f7 = text-1) */} N S E W {/* clock-hand needle */} {/* center dot */} ); } function ProgressBar({ value, max, gradient, label }: { value: number; max: number; gradient: string; label: string }) { const pct = Math.min(100, (value / max) * 100); return (
{label}
); } function StatCard({ value, label, valueClass = 'text-primary-cyan' }: { value: string; label: string; valueClass?: string }) { return (
{value} {label}
); } /* ── Main Component ───────────────────────────────────────── */ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { if (!weatherData) { return (

지도에서 해양 지점을 클릭하세요

); } const { wind, wave, temperature, pressure, visibility, salinity, astronomy, alert, forecast, } = weatherData; return (
{/* ── Header ─────────────────────────────────────────── */}
📍 {weatherData.stationName} 기상예보관

{weatherData.location.lat.toFixed(2)}°N, {weatherData.location.lon.toFixed(2)}°E · {weatherData.currentTime}

{/* ── Scrollable Content ─────────────────────────────── */}
{/* ── Summary Cards ──────────────────────────────── */}
{wind.speed.toFixed(1)} 풍속 (m/s)
{wave.height.toFixed(1)} 파고 (m)
{temperature.current.toFixed(1)} 수온 (°C)
{/* ── 바람 현황 ──────────────────────────────────── */}
🏳️ 바람 현황
풍향{wind.directionLabel} {wind.direction}° 기압{pressure} hPa 1k 최고{wind.speed_1k.toFixed(1)} 3k 평균{wind.speed_3k.toFixed(1)} 가시거리{visibility} km
{/* ── 파도 ───────────────────────────────────────── */}
🌊 파도
{/* ── 수온 · 공기 ────────────────────────────────── */}
💧 수온 · 공기
{/* ── 시간별 예보 ────────────────────────────────── */}
🕐 시간별 예보
{forecast.map((fc, i) => (
{fc.hour} {fc.icon} {fc.temperature}° {fc.windSpeed}
))}
{/* ── 천문 · 조석 ────────────────────────────────── */}
☀️ 천문 · 조석
{astronomy && ( <>
🌅 일출 {astronomy.sunrise}
🌇 일몰 {astronomy.sunset}
🌙 월출 {astronomy.moonrise}
🌜 월몰 {astronomy.moonset}
🌓 {astronomy.moonPhase}
조차 {astronomy.tidalRange}m
)}
{/* ── 날씨 특보 ──────────────────────────────────── */} {alert && (
🚨 날씨 특보
주의 {alert}
)}
); }