import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { ArrowLeft, MapPin, Calendar } from "lucide-react" import Link from "next/link" import { notFound } from "next/navigation" import { getApiUrl } from "@/lib/api-config" import { CommentSection } from "@/components/social/comment-section" import { EntityRating } from "@/components/social/entity-rating" import { EntityReviews } from "@/components/reviews/entity-reviews" import { SocialWrapper } from "@/components/social/social-wrapper" async function getVenue(id: string) { try { const res = await fetch(`${getApiUrl()}/venues/${id}`, { cache: 'no-store' }) if (!res.ok) return null return res.json() } catch (e) { console.error(e) return null } } async function getVenueShows(id: string) { try { const res = await fetch(`${getApiUrl()}/shows/?venue_id=${id}`, { cache: 'no-store' }) if (!res.ok) return [] return res.json() } catch (e) { console.error(e) return [] } } export default async function VenueDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const venue = await getVenue(id) const shows = await getVenueShows(id) if (!venue) { notFound() } return (

{venue.name}

{venue.city}, {venue.state} {venue.country}

Shows at {venue.name} {shows.length > 0 ? (
{shows.map((show: any) => (
{new Date(show.date).toLocaleDateString()}
{show.tour && ( {show.tour.name} )}
))}
) : (

No shows found for this venue.

)}
Venue Details {venue.capacity && (
Capacity {venue.capacity.toLocaleString()}
)} {venue.notes && (

{venue.notes}

)}
) }