import React from 'react'; import { xyToLatLon } from '../utils/geo'; export default function FlightModal({ flight, onClose }) { if (!flight) return null; return (
Call Sign: {flight.callsign} ({flight.type} | {flight.weight_class})
Location: {xyToLatLon(flight.x, flight.y).map(val => val.toFixed(6)).join(', ')}
State: {flight.state} {flight.is_holding ? "(Hold)" : ""}
Altitude: {flight.altitude} ft
Heading: {flight.heading}° (Target: {flight.target_heading}°)
Speed: {flight.speed} kts (Target: {flight.target_speed} kts)
Fuel Remaining: {flight.fuel_level?.toFixed(1)}%
Emergency Level: {flight.emergency_index === 0 ? "0 (Normal)" : flight.emergency_index === 1 ? "1 (Low Fuel)" : flight.emergency_index === 3 ? "3 (Critical)" : flight.emergency_index}
Active STAR: {flight.active_star || 'None'} (WP: {flight.wp_index})