import { useState } from 'react'; type Props = { images: string[]; alt: string; }; export default function CoffeeDetailGallery({ images, alt }: Props) { const [index, setIndex] = useState(0); const safeImages = images.length > 0 ? images : ['']; const current = safeImages[index] || ''; return (
{current ? ( {alt} ) : (
No image available
)}
{safeImages.length > 1 && (
{safeImages.map((img, i) => ( ))}
)}
); }