import { X, Ruler, Activity } from 'lucide-react'; import type { CelestialBody } from '../types'; interface FocusInfoProps { body: CelestialBody | null; onClose: () => void; } export function FocusInfo({ body, onClose }: FocusInfoProps) { if (!body) return null; // Calculate distance if position is available const pos = body.positions[0]; const distance = pos ? Math.sqrt(pos.x ** 2 + pos.y ** 2 + pos.z ** 2).toFixed(2) : '---'; const isProbe = body.type === 'probe'; const isActive = body.is_active !== false; return ( // Remove fixed positioning, now handled by parent container (Html component in 3D)
{/* Main Info Card */}
{/* Close Button */} {/* Header */}

{body.name_zh || body.name}

{isProbe ? '探测器' : '天体'}

{body.description || '暂无描述'}

{/* Stats Grid */}
日心距离
{distance} AU
{isProbe && (
状态
{isActive ? '运行中' : '已失效'}
)}
{/* Connecting Line/Triangle pointing down to the body */}
); }