import React from 'react'; import type { MachineAnimationSnapshot } from '../../animations/types'; export interface AnimationTransportProps { snapshot: MachineAnimationSnapshot; onPlay: () => void; onPause: () => void; onResume: () => void; onRestart: (autoPlay?: boolean) => void; onStep: (steps?: number) => void; onRpmChange: (rpm: number) => void; onTimeScaleChange: (timeScale: number) => void; onLoopChange: (loop: boolean) => void; onStepModeChange: (enabled: boolean) => void; } function formatSeconds(seconds: number): string { return `${seconds.toFixed(2)}s`; } export function AnimationTransport({ snapshot, onPlay, onPause, onResume, onRestart, onStep, onRpmChange, onTimeScaleChange, onLoopChange, onStepModeChange, }: AnimationTransportProps): JSX.Element { const isPlaying = snapshot.status === 'playing'; return (

Animation

Cycle {snapshot.cycleIndex + 1} · {Math.round(snapshot.cycleProgress * 100)}%

{snapshot.status}
Elapsed {formatSeconds(snapshot.elapsedSeconds)}
Cycle duration {formatSeconds(snapshot.cycleDurationSeconds)}
Step {snapshot.stepIndex + 1}/{snapshot.stepCount}
); }