mirror of
https://github.com/sussy-code/smov.git
synced 2026-05-12 21:00:37 +00:00
17 lines
384 B
TypeScript
17 lines
384 B
TypeScript
import { usePlayerStore } from "@/stores/player/store";
|
|
|
|
export function Pause() {
|
|
const display = usePlayerStore((s) => s.display);
|
|
const { isPaused } = usePlayerStore((s) => s.mediaPlaying);
|
|
|
|
const toggle = () => {
|
|
if (isPaused) display?.play();
|
|
else display?.pause();
|
|
};
|
|
|
|
return (
|
|
<button type="button" onClick={toggle}>
|
|
play/pause
|
|
</button>
|
|
);
|
|
}
|