import { Button, Container } from '@ifrc-go/ui'; import { ChevronLeftLineIcon, ChevronRightLineIcon } from '@ifrc-go/icons'; import styles from '../../pages/UploadPage/UploadPage.module.css'; interface ImagePreviewSectionProps { files: File[]; imageUrl: string | null; preview: string | null; onViewFullSize: (imageData?: { file: File; index: number }) => void; // Carousel props for step 2b currentImageIndex?: number; onGoToPrevious?: () => void; onGoToNext?: () => void; onGoToImage?: (index: number) => void; showCarousel?: boolean; } export default function ImagePreviewSection({ files, imageUrl, preview, onViewFullSize, currentImageIndex = 0, onGoToPrevious, onGoToNext, onGoToImage, showCarousel = false, }: ImagePreviewSectionProps) { // If carousel is enabled and multiple files, show carousel if (showCarousel && files.length > 1) { return (
{files[currentImageIndex] ? ( {`Image ) : (
No image available
)}
{/* Carousel Navigation */}
{files.map((_, index) => ( ))}
{/* View Image Button for Carousel */}
); } // Original implementation for single image or non-carousel mode if (files.length > 1) { return (
{files.map((file, index) => (
{`Image
))}
); } return (
Uploaded image preview
); }