Add static assets to nginx

This commit is contained in:
2023-09-18 15:03:44 +02:00
committed by Clément Le Bihan
parent 49a735631a
commit 94658d4379
9 changed files with 73 additions and 10 deletions
+13
View File
@@ -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;
};