import { Grid } from '@mui/material'; import { BigCarouselWrapper, BigImgCarousel, BigItemCarouselWrapper, BigSlideButtonLeft, BigSlideButtonRight, BigVideoCarousel } from './styles'; import { BigCarouselProps, NEXT, PREV } from './types'; import { ASSETS_URL } from '../../consts/common'; import type { Direction } from './SmallCarousel'; const BigCarousel = ({ handleBigCarousel, items, index, open, isSmall, fallBackImg, leftClickEvent, rightClickEvent, vidoStartEvent }: BigCarouselProps) => { const eventHandler = (event: () => void, dir?: Direction, action?: (dir: Direction) => void) => () => { event(); if (action && dir) action(dir); }; return ( {items && ( )} {!items ? ( ) : items[index].videoUrl ? ( { vidoStartEvent(); }} isSmall={isSmall} src={`${items[index].videoUrl}?autoplay=1`} title="YouTube video player" allow="autoplay" allowFullScreen={true} frameBorder="0" /> ) : ( )} {items && ( { rightClickEvent(); handleBigCarousel(NEXT); }} /> )} ); }; export default BigCarousel;