import { memo } from 'react'; import { getLoopPositionPercent } from '../domain/timeline'; import { INSTRUMENT_BY_ID } from '../domain/instruments'; import type { BeatPoint } from '../domain/sequencer'; import type { InstrumentId } from '../domain/instruments'; interface BeatSelectionHintProps { selectedBeat: BeatPoint | undefined; focusedSoundId: InstrumentId | null; colorBySoundId: Partial>; totalSteps: number; } export const BeatSelectionHint = memo(function BeatSelectionHint({ selectedBeat, focusedSoundId, colorBySoundId, totalSteps, }: BeatSelectionHintProps) { const soundId = selectedBeat?.soundId ?? focusedSoundId; if (!soundId) return

; const sound = INSTRUMENT_BY_ID[soundId]; return (

{sound.label} {selectedBeat && ( <> ยท Step {getLoopPositionPercent(selectedBeat.step, totalSteps)}% selected )} {!selectedBeat && ' ring selected'}

); });