export const dynamic = "force-dynamic"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getSvaMeta, getSvaIntroSegments } from "@/lib/sva"; import { ogForBook } from "@/lib/og"; import { PageHeader } from "@/components/layout/page-header"; import { JsonLd } from "@/components/seo/json-ld"; import { bookJsonLd } from "@/lib/jsonld"; import { Card, CardContent } from "@/components/ui/card"; export function generateMetadata(): Metadata { return ogForBook("sva"); } export default async function SvaPage() { const meta = await getSvaMeta(); if (!meta) notFound(); const introSegments = await getSvaIntroSegments(); // Split intro segments into front matter (before chapters) and back matter (after) const frontMatter = introSegments.filter((seg) => seg.order < 99); const backMatter = introSegments.filter((seg) => seg.order >= 99); return (
← Books

{meta.title}

{meta.author}

{/* Description */} {meta.description && (

{meta.description}

)} {/* Front Matter */} {frontMatter.length > 0 && (

Front Matter

    {frontMatter.map((seg) => (
  • {seg.title}

  • ))}
)} {/* Parts — hierarchical parent → song (sub-chapter) structure */} {meta.chapters.map((ch) => (

Part {ch.number}: {ch.title}

    {ch.subChapters.map((sub) => (
  • {sub.title}

  • ))}
))} {/* Back Matter */} {backMatter.length > 0 && (

Back Matter

    {backMatter.map((seg) => (
  • {seg.title}

  • ))}
)}
); }