CarouselItem.jsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Carousel from "react-material-ui-carousel";
  2. import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
  3. import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
  4. import {Box} from "@mui/material";
  5. import {ImageItem} from "./ImageItem";
  6. export const CarouselItem = ({images}) => {
  7. return (
  8. <Carousel
  9. navButtonsProps={{
  10. style: {
  11. backgroundColor: 'transparent',
  12. color: '#000',
  13. borderRadius: 0
  14. }
  15. }}
  16. NextIcon={<ArrowForwardIosIcon/>}
  17. PrevIcon={<ArrowBackIosNewIcon/>}
  18. fullHeightHover={true}
  19. >
  20. {
  21. images.map((item, index) =>
  22. <Box
  23. key={index}
  24. sx={{
  25. width: '100%',
  26. display: 'flex',
  27. justifyContent: 'center',
  28. height: '340px'
  29. }}
  30. >
  31. <ImageItem
  32. key={item._id}
  33. images={item}
  34. />
  35. </Box>
  36. )
  37. }
  38. </Carousel>
  39. )
  40. }