refactor: rewrite video player
This commit is contained in:
34 files changed
+3766
-3007
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { IconButton } from "@mui/material";
|
||||
import React from "react";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
import { usePlaybackStore } from "@/utils/store/playback";
|
||||
|
||||
const PlayPauseButton = () => {
|
||||
const { isPlayerPlaying, toggleIsPlaying } = usePlaybackStore(
|
||||
useShallow((state) => ({
|
||||
isPlayerPlaying: state.playerState.isPlayerPlaying,
|
||||
toggleIsPlaying: state.toggleIsPlaying,
|
||||
})),
|
||||
);
|
||||
return (
|
||||
<IconButton onClick={toggleIsPlaying}>
|
||||
<span className="material-symbols-rounded fill">
|
||||
{isPlayerPlaying ? "pause" : "play_arrow"}
|
||||
</span>
|
||||
</IconButton>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayPauseButton;
|
||||
Reference in new issue
Block a user