"use client"; import { Pause, Play, Repeat2, ShoppingBag } from "lucide-react"; import { useEffect, useState } from "react"; export interface PreviewSet { theme: string; blurb: string; meals: { slot: string; title: string; cost: string }[]; total: string; sharedItems: number; itemCount: number; } const INTERVAL_MS = 5000; export function RotatingPreview({ sets }: { sets: PreviewSet[] }) { const [index, setIndex] = useState(0); const [paused, setPaused] = useState(false); const [hovering, setHovering] = useState(false); const running = !paused && !hovering; useEffect(() => { if (!running || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; const timer = window.setInterval(() => setIndex((i) => (i + 1) % sets.length), INTERVAL_MS); return () => window.clearInterval(timer); }, [running, index, sets.length]); const set = sets[index]; return (
setHovering(true)} onMouseLeave={() => setHovering(false)} onFocus={() => setHovering(true)} onBlur={() => setHovering(false)} > {/* Architectural editorial frame — crisp 1px border & tactile offset shadow instead of blurred glow blobs */}
{/* Top progress rule */}

Sample menu · 2 people

{set.theme}

{set.blurb}
    {set.meals.map((m) => (
  • {m.slot}

    {m.title}

    {m.cost}/meal

  • ))}
{/* Receipt tear-off footer */}
{set.sharedItems} shared store items {set.itemCount} pkgs · {set.total}
{/* Accessible 40x40px pagination & playback controls */}
{sets.map((s, i) => ( ))}
); }