"use client" import { useEffect, useState } from "react" import { getApiUrl } from "@/lib/api-config" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import Link from "next/link" import { Calendar, MapPin } from "lucide-react" interface Show { id: number date: string venue: { id: number name: string city: string state: string } } export default function ShowsPage() { const [shows, setShows] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { fetch(`${getApiUrl()}/shows/?limit=50`) .then(res => res.json()) .then(data => { // Sort by date descending const sorted = data.sort((a: Show, b: Show) => new Date(b.date).getTime() - new Date(a.date).getTime() ) setShows(sorted) }) .catch(console.error) .finally(() => setLoading(false)) }, []) if (loading) return
Loading shows...
return (

Shows

Browse the complete archive of performances.

{shows.map((show) => ( {new Date(show.date).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}
{show.venue?.name}, {show.venue?.city}, {show.venue?.state}
))}
) }