import type { State } from '../types' ; import type { MovementStatus } from './types' ; export const getLightsOn = ( state , robotName ) : boolean | null => { const lightsOn = state . robotControls [ robotName ] ?. lightsOn ; return lightsOn != null ? lightsOn : null ; } ; export const getMovementStatus = ( state , robotName ) : MovementStatus | null => { return state . robotControls [ robotName ] ?. movementStatus || null ; } ; export const getMovementError = ( state , robotName ) : string | null => { const errorMessage = state . robotControls [ robotName ] ?. movementError ; return errorMessage != null ? errorMessage : null ; } ;