"use client" import { useEffect, useState } from "react" import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card" import { Calendar, MapPin, Ticket } from "lucide-react" import Link from "next/link" import { getApiUrl } from "@/lib/api-config" import { Skeleton } from "@/components/ui/skeleton" import { Badge } from "@/components/ui/badge" export function RecommendedShows() { const [shows, setShows] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { const token = localStorage.getItem("token") if (!token) return fetch(`${getApiUrl()}/recommendations/shows/recent?limit=4`, { headers: { Authorization: `Bearer ${token}` } }) .then(res => res.json()) .then(data => setShows(data)) .catch(err => console.error(err)) .finally(() => setLoading(false)) }, []) if (loading) return if (shows.length === 0) return null return ( Recommended Shows Recent shows from bands you follow
{shows.map((show) => (
{show.date}
{show.venue_name}
{show.vertical_name}
))}
) }