import { VERTICALS } from "@/contexts/vertical-context" import { notFound } from "next/navigation" import { getApiUrl } from "@/lib/api-config" interface Props { params: { vertical: string } } export function generateStaticParams() { return VERTICALS.map((v) => ({ vertical: v.slug, })) } async function getSongs(verticalSlug: string) { try { const res = await fetch(`${getApiUrl()}/songs?vertical=${verticalSlug}`, { next: { revalidate: 60 } }) if (!res.ok) return [] return res.json() } catch { return [] } } export default async function SongsPage({ params }: Props) { const vertical = VERTICALS.find((v) => v.slug === params.vertical) if (!vertical) { notFound() } const songs = await getSongs(vertical.slug) return (

{vertical.name} Songs

{songs.length === 0 ? (

No songs imported yet for {vertical.name}.

Run the data importer to populate songs.

) : (
{songs.map((song: any) => (
{song.title}
{song.original_artist && (
Cover of {song.original_artist}
)}
{song.times_played || 0} plays
))}
)}
) }