import React, { CSSProperties, HTMLAttributes, memo } from 'react'; import { useAudio } from '../audioContext'; import LoopIcon from '../icons/LoopIcon'; interface ButtonProps extends Partial> { bgColor: string; } export default memo(function LoopButton({ color, bgColor, style, ...props }: ButtonProps) { const { loop, setLoop } = useAudio(); /** * Change loop to repeat > no-repeat > repeat all */ const onLoop = () => { if (loop === 'no-repeat') setLoop('repeat-once'); else if (loop === 'repeat-once') setLoop('repeat-all'); else setLoop('no-repeat'); }; return ( ); });