import { useTelemetryFrame } from '../context/TelemetryContext.jsx'; import { useControlSystem } from '../controls/index.js'; import DiscordInviteButton from './DiscordInviteButton.jsx'; export default function DrivePanel() { const { state: { roverId }, actions, } = useControlSystem(); const frame = useTelemetryFrame(roverId); const sensors = frame?.sensors || {}; const drivingMode = (sensors.oiMode?.label || '').toLowerCase() === 'full'; const docked = Boolean(sensors.chargingSources?.homeBase); const charging = Boolean( sensors.chargingState?.label && sensors.chargingState.label.toLowerCase() !== 'not charging', ); const handleStartDrive = () => { if (!roverId) return; actions.setMode('drive'); actions.runMacro('drive-sequence'); }; const handleDock = () => { if (!roverId) return; actions.setMode('dock'); actions.runMacro('seek-dock'); }; return (
{/*
Drive control {roverId ? 'Ready to drive' : 'No rover assigned'}
*/}
{/* */} {/* kjfhdljhdsaflkjf */}
); } function ActionCard({ title, description, statuses, tone, onClick, disabled, footnote }) { const colors = tone === 'indigo' ? { base: 'bg-indigo-600', hover: 'hover:bg-indigo-500' } : { base: 'bg-emerald-600', hover: 'hover:bg-emerald-500' }; return ( ); }