import React, { useRef } from "react"; import { motion, useMotionValue } from "framer-motion"; import { type Stop } from "../data/StopDataProvider"; import StopGalleryItem from "./StopGalleryItem"; import "./StopGallery.css"; interface StopGalleryProps { stops: Stop[]; title: string; emptyMessage?: string; } const StopGallery: React.FC = ({ stops, title, emptyMessage }) => { const scrollRef = useRef(null); const x = useMotionValue(0); if (stops.length === 0 && emptyMessage) { return (

{title}

{emptyMessage}

); } if (stops.length === 0) { return null; } return (

{title}

{stops.length}
{stops.map((stop) => ( ))}
{stops.map((_, index) => (
))}
); }; export default StopGallery;