import { format } from 'date-fns' ; import type { Axis } from '../../molecules/JogControls/types' ; import type { VectorTuple } from '../../redux/sessions/types' ; const ORDERED_AXES = [ 'x' , 'y' , 'z' ] ; export function formatJogVector ( axis , direction , step ) { const vector = [ 0 , 0 , 0 ] ; const index = ORDERED_AXES . findIndex ( a => a === axis ) ; if ( index >= 0 ) { vector [ index ] = step * direction ; } return vector ; } export function formatLastModified ( lastModified ) { return typeof lastModified === 'string' ? format ( new Date ( lastModified ) , 'MMMM dd, yyyy HH:mm' ) : 'unknown' ; }