Centralize site metadata and social URLs for JSON-LD, expose llmstxt.org content and per-page .md routes for LLM crawlers, and refactor blog/FAQ/events pages with shared components. Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import { Navbar } from "@/components/public/Navbar";
|
|
import { Footer } from "@/components/public/Footer";
|
|
import { FaqAccordion } from "@/components/public/FaqAccordion";
|
|
import { FaqPageJsonLd, BreadcrumbJsonLd } from "@/components/public/JsonLd";
|
|
import { apiUrl } from "@/lib/api-base";
|
|
|
|
interface FaqItem {
|
|
id: string;
|
|
question: string;
|
|
answer: string;
|
|
order: number;
|
|
showOnHomepage: boolean;
|
|
}
|
|
|
|
async function fetchFaqs(): Promise<FaqItem[]> {
|
|
try {
|
|
const res = await fetch(apiUrl("/faqs?all=true"), {
|
|
next: { revalidate: 300 },
|
|
});
|
|
if (!res.ok) return [];
|
|
const data = await res.json();
|
|
return Array.isArray(data) ? data : [];
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
export default async function FaqPage() {
|
|
const items = await fetchFaqs();
|
|
|
|
return (
|
|
<>
|
|
{items.length > 0 && (
|
|
<FaqPageJsonLd
|
|
items={items.map((i) => ({ question: i.question, answer: i.answer }))}
|
|
/>
|
|
)}
|
|
<BreadcrumbJsonLd
|
|
items={[
|
|
{ name: "Home", href: "/" },
|
|
{ name: "FAQ", href: "/faq" },
|
|
]}
|
|
/>
|
|
<Navbar />
|
|
<div className="min-h-screen">
|
|
<div className="max-w-3xl mx-auto px-8 pt-16 pb-24">
|
|
<h1 className="text-4xl font-black mb-4">Frequently Asked Questions</h1>
|
|
<p className="text-on-surface-variant text-lg mb-12">
|
|
Everything you need to know about the Belgian Bitcoin Embassy.
|
|
</p>
|
|
|
|
{items.length === 0 ? (
|
|
<p className="text-on-surface-variant">No FAQs available yet.</p>
|
|
) : (
|
|
<FaqAccordion items={items} />
|
|
)}
|
|
</div>
|
|
</div>
|
|
<Footer />
|
|
</>
|
|
);
|
|
}
|