mirror of
https://github.com/sussy-code/smov.git
synced 2026-05-13 05:10:38 +00:00
21 lines
603 B
TypeScript
21 lines
603 B
TypeScript
import { Icons } from "@/components/Icon";
|
|
import { VideoPlayerButton } from "@/components/player/internals/Button";
|
|
import { usePlayerStore } from "@/stores/player/store";
|
|
|
|
export function Pause(props: { iconSizeClass?: string }) {
|
|
const display = usePlayerStore((s) => s.display);
|
|
const { isPaused } = usePlayerStore((s) => s.mediaPlaying);
|
|
|
|
const toggle = () => {
|
|
if (isPaused) display?.play();
|
|
else display?.pause();
|
|
};
|
|
|
|
return (
|
|
<VideoPlayerButton
|
|
iconSizeClass={props.iconSizeClass}
|
|
onClick={toggle}
|
|
icon={isPaused ? Icons.PLAY : Icons.PAUSE}
|
|
/>
|
|
);
|
|
}
|