Add static assets to nginx
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
export const Metronome = ({ paused = false, bpm }: { paused?: boolean; bpm: number }) => {
|
||||
const ref = useRef<HTMLAudioElement | null>(null);
|
||||
useEffect(() => {
|
||||
const int = setInterval(() => {
|
||||
if (!ref.current) ref.current = new Audio("/assets/metronome.mp3");
|
||||
ref.current.play();
|
||||
}, 60000 / bpm);
|
||||
return () => clearInterval(int);
|
||||
}, []);
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user