"use client" import { useEffect, useState } from "react" import { Card, CardContent } from "@/components/ui/card" import { Calendar, MapPin } from "lucide-react" import Link from "next/link" import { getApiUrl } from "@/lib/api-config" export function UserAttendanceList({ userId }: { userId: number }) { const [shows, setShows] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { const token = localStorage.getItem("token") if (!token) return fetch(`${getApiUrl()}/users/${userId}/attendance`, { headers: { Authorization: `Bearer ${token}` } }) .then(res => res.json()) .then(data => setShows(data)) .catch(err => console.error(err)) .finally(() => setLoading(false)) }, [userId]) if (loading) return
Loading attendance...
if (shows.length === 0) { return (

No shows attended yet

Mark shows as attended to track your concert history

Browse shows
) } return (
{shows.map((show) => (
{new Date(show.date).toLocaleDateString()}
{show.venue && (
{show.venue.name}
)}
))}
) }