import { Box, Button } from "@mui/material"; import { AnimatePresence, motion } from "motion/react"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const SkipSegmentButton = () => { const { mediaSegments, currentSegmentIndex, skipSegment, activeSegmentId, isUserHovering, isPlayerPlaying, isUserSeeking, } = usePlaybackStore( useShallow((state) => ({ mediaSegments: state.metadata.mediaSegments, currentSegmentIndex: state.nextSegmentIndex - 1, skipSegment: state.skipSegment, activeSegmentId: state.activeSegmentId, isUserHovering: state.playerState.isUserHovering, isPlayerPlaying: state.playerState.isPlayerPlaying, isUserSeeking: state.playerState.isUserSeeking, })), ); const shouldShow = mediaSegments?.Items?.length && currentSegmentIndex >= 0 && activeSegmentId && mediaSegments?.Items?.[currentSegmentIndex].Type !== "Outro"; return ( {shouldShow && ( )} ); }; const SkipSegmentButtonMemo = React.memo(SkipSegmentButton); export default SkipSegmentButtonMemo;