"use client" import { useEffect, useState } from "react" import Link from "next/link" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { getApiUrl } from "@/lib/api-config" import { Loader2, ChevronRight, Music, Calendar, MapPin, ListMusic } from "lucide-react" interface Vertical { id: number name: string slug: string description: string | null color: string | null show_count?: number song_count?: number venue_count?: number } export function BandsGrid() { const [verticals, setVerticals] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { async function fetchVerticals() { try { const res = await fetch(`${getApiUrl()}/verticals`) if (res.ok) { const data = await res.json() setVerticals(data) } } catch (error) { console.error("Failed to fetch verticals", error) } finally { setLoading(false) } } fetchVerticals() }, []) if (loading) { return (
) } return (
{verticals.map((vertical) => (
{vertical.name.substring(0, 2).toUpperCase()}
{vertical.name}
{vertical.description && (

{vertical.description}

)}
e.stopPropagation()} > Shows e.stopPropagation()} > Songs e.stopPropagation()} > Venues
))}
) }