karusell
This commit is contained in:
26
src/components/GalleryCarousel.tsx
Normal file
26
src/components/GalleryCarousel.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { Carousel } from '@mantine/carousel';
|
||||
import VideoPlayer from "./VideoPlayer"; // assuming VideoPlayer and ImageViewer are custom components to display videos and photos
|
||||
import ImageViewer from "./ImageViewer"; // assuming VideoPlayer and ImageViewer are custom components to display videos and photos
|
||||
|
||||
type Props = {
|
||||
videos: string[];
|
||||
photos: string[];
|
||||
};
|
||||
|
||||
const GalleryCarousel: React.FC<Props> = ({ videos, photos }): JSX.Element => {
|
||||
return (
|
||||
<Carousel
|
||||
variant="light"
|
||||
>
|
||||
{photos.map((photo, index) => (
|
||||
<ImageViewer key={`gallery-photo-${index}`} url={photo} />
|
||||
))}
|
||||
{videos.map((video, index) => (
|
||||
<VideoPlayer key={`gallery-video-${index}`} url={video} />
|
||||
))}
|
||||
</Carousel>
|
||||
);
|
||||
};
|
||||
|
||||
export default GalleryCarousel;
|
||||
Reference in New Issue
Block a user