import { AnimatePresence, motion } from 'framer-motion'; import PropTypes from 'prop-types'; import { defaultSlideUpVariant, defaultViewerStreamActionTransition } from '../ViewerStreamActions/viewerStreamActionsTheme'; import { commonProductContainerClasses } from '../ViewerStreamActions/Product/ProductTheme'; import { createAnimationProps } from '../../../helpers/animationPropsHelper'; import { sanitizeAmazonProductData } from '../../../helpers/streamActionHelpers'; import { STREAM_ACTION_NAME } from '../../../constants'; import { usePlayerContext } from '../contexts/Player'; import { useProfileViewAnimation } from '../contexts/ProfileViewAnimation'; import { useViewerStreamActions } from '../../../contexts/ViewerStreamActions'; import NoticeViewerStreamAction from '../ViewerStreamActions/Notice'; import ProductViewerStreamAction from '../ViewerStreamActions/Product/components/Product'; import QuizViewerStreamAction from '../ViewerStreamActions/QuizCard'; const PlayerViewerStreamActions = ({ isPollActive, isPopupOpen, onClickPlayerHandler, shouldShowStream }) => { const { currentViewerStreamActionData, currentViewerStreamActionName, setCurrentViewerAction, shouldRenderActionInTab } = useViewerStreamActions(); const { chatAnimationControls, getProfileViewAnimationProps } = useProfileViewAnimation(); const { isOverlayVisible } = usePlayerContext(); return ( {!isPollActive && currentViewerStreamActionName === STREAM_ACTION_NAME.QUIZ && !shouldRenderActionInTab && ( )} {!isPollActive && [ STREAM_ACTION_NAME.PRODUCT, STREAM_ACTION_NAME.AMAZON_PRODUCT ].includes(currentViewerStreamActionName) && !shouldRenderActionInTab && ( )} {!isPollActive && currentViewerStreamActionName === STREAM_ACTION_NAME.NOTICE && ( )} ); }; PlayerViewerStreamActions.propTypes = { isPollActive: PropTypes.bool, isPopupOpen: PropTypes.bool.isRequired, onClickPlayerHandler: PropTypes.func.isRequired, shouldShowStream: PropTypes.bool }; PlayerViewerStreamActions.defaultProps = { isPollActive: false, shouldShowStream: false }; export default PlayerViewerStreamActions;