From e51cdd89afc08274ca622e18b8127feca29e90a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 22:49:47 +0000 Subject: Add gallery components and improve search functionality Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com> --- src/frontend/app/components/StopGallery.tsx | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/frontend/app/components/StopGallery.tsx (limited to 'src/frontend/app/components/StopGallery.tsx') diff --git a/src/frontend/app/components/StopGallery.tsx b/src/frontend/app/components/StopGallery.tsx new file mode 100644 index 0000000..7dda637 --- /dev/null +++ b/src/frontend/app/components/StopGallery.tsx @@ -0,0 +1,58 @@ +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; -- cgit v1.3