"use client"; import { useEffect, useRef } from "react"; import Link from "next/link"; import { gsap } from "gsap"; import StorefrontHeader from "@/components/storefront/StorefrontHeader"; import StorefrontFooter from "@/components/storefront/StorefrontFooter"; import LayoutContainer from "@/components/layout/LayoutContainer"; import type { PublicStop } from "@/actions/stops"; type Props = { stops: PublicStop[]; brandName: string; brandSlug: string; }; export default function TuxedoStopsList({ stops, brandName, brandSlug }: Props) { const containerRef = useRef(null); useEffect(() => { if (!containerRef.current) return; const ctx = gsap.context(() => { gsap.from(".stop-card", { y: 30, opacity: 0, duration: 0.5, stagger: 0.08, ease: "power3.out", }); }, containerRef); return () => ctx.revert(); }, []); const now = new Date(); const upcomingStops = stops.filter((s) => new Date(s.date) >= now); const pastStops = stops.filter((s) => new Date(s.date) < now); return (

{brandName}

Pickup Stops

Fresh Olathe Sweet™ sweet corn delivered to a stop near you.

{upcomingStops.length === 0 ? (

No Upcoming Stops Yet

The corn is still ripening in the field. New pickup stops are added every week — check back soon, or browse the full season schedule.

Back to Tuxedo Corn Download Full Schedule
) : (
{upcomingStops.map((stop) => (
{new Date(stop.date).toLocaleDateString("en-US", { month: "short" })} {new Date(stop.date).getDate()}

{stop.city}, {stop.state}

{stop.location}

{stop.address && (

{stop.address}

)}

{stop.time}

{stop.cutoff_time && (

Order by {new Date(stop.cutoff_time).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" })}

)}
))} {pastStops.length > 0 && (

Past Stops

{pastStops.slice(0, 5).map((stop) => (
{new Date(stop.date).toLocaleDateString("en-US", { month: "short", day: "numeric" })}

{stop.city}, {stop.state}

{stop.location}

Completed
))}
)}
)}
); }