// Info Column // Purpose: Defines the Info Column module and the local helpers/components used in this file. // Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit. import RoverMediaPlayer from '../../../components/RoverMediaPlayer/index.jsx'; import BatteryBar from '../../../components/BatteryBar/index.jsx'; import { roverNameChromeStyle } from '../../../lib/roverColor.js'; import { getBatteryVisual } from '../utils.js'; import AutoFitText from './AutoFitText.jsx'; export default function InfoColumn({ rover, frame, driverLabel, sessionInfo, videoMode = 'snapshot', snapshotFeed, withDivider = false, showPreview = true, variant = 'stacked', }) { const batteryVisual = getBatteryVisual({ rover, frame }); const batteryPercent = batteryVisual?.available ? batteryVisual.percentDisplay : null; const isActiveView = variant === 'active'; return (
{isActiveView ? (
{rover.name || rover.id}
{driverLabel ? (
{driverLabel}
) : (
)}
{batteryPercent == null ? '--%' : `${batteryPercent}%`}
) : ( <>
{rover.name || rover.id}
{driverLabel ? (
{driverLabel}
) : null}
{batteryPercent == null ? '--%' : `${batteryPercent}%`}
{showPreview ? (
) : null}
)}
); }