import { ActivityFeed } from "@/components/feed/activity-feed" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import Link from "next/link" import { Trophy, Music, MapPin, Calendar, ChevronRight, Star } from "lucide-react" import { getApiUrl } from "@/lib/api-config" interface Show { id: number date: string venue?: { id: number name: string city?: string state?: string } tour?: { id: number name: string } } interface Song { id: number title: string performance_count?: number avg_rating?: number } async function getRecentShows(): Promise { try { const res = await fetch(`${getApiUrl()}/shows/recent?limit=8`, { cache: 'no-store', next: { revalidate: 60 } }) if (!res.ok) return [] return res.json() } catch (e) { console.error('Failed to fetch recent shows:', e) return [] } } async function getTopSongs(): Promise { try { const res = await fetch(`${getApiUrl()}/stats/top-songs?limit=5`, { cache: 'no-store', next: { revalidate: 300 } }) if (!res.ok) return [] return res.json() } catch (e) { console.error('Failed to fetch top songs:', e) return [] } } async function getStats() { try { const [showsRes, songsRes, venuesRes] = await Promise.all([ fetch(`${getApiUrl()}/shows?limit=1`, { cache: 'no-store' }), fetch(`${getApiUrl()}/songs?limit=1`, { cache: 'no-store' }), fetch(`${getApiUrl()}/venues?limit=1`, { cache: 'no-store' }) ]) // These endpoints return arrays, we need to get counts differently // For now we'll just show the data we have return { shows: 0, songs: 0, venues: 0 } } catch (e) { return { shows: 0, songs: 0, venues: 0 } } } export default async function Home() { const [recentShows, topSongs] = await Promise.all([ getRecentShows(), getTopSongs() ]) return (
{/* Hero Section */}

Elmeg

The ultimate community archive for Goose history.
Discover shows, rate performances, and find the heady versions.

{/* Recent Shows */}

Recent Shows

View all shows
{recentShows.length > 0 ? (
{recentShows.map((show) => (
{new Date(show.date).toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' })}
{show.venue && (
{show.venue.name}
)} {show.venue?.city && (
{show.venue.city}{show.venue.state ? `, ${show.venue.state}` : ''}
)} {show.tour && (
{show.tour.name}
)}
))}
) : (

No shows yet. Check back soon!

)}
{/* Top Songs */}

Top Songs

All songs
{topSongs.length > 0 ? (
    {topSongs.map((song, idx) => (
  • {idx + 1}
    {song.title}
    {song.performance_count && (
    {song.performance_count} performances
    )}
  • ))}
) : (
No songs yet
)}
{/* Activity Feed */}

Recent Activity

View all
{/* Quick Links */}

Shows

Browse the complete archive

Venues

Find your favorite spots

Songs

Explore the catalog

Leaderboards

Top rated everything

) }