CarouselItem.jsx 1.3 KB

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