import Link from "next/link"; import { notFound } from "next/navigation"; const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080"; export default async function BuildBreakdownPage({ params, }: { params: { buildId: string }; }) { // You may need to add/confirm this endpoint in backend: // GET /api/v1/builds/{uuid} const res = await fetch(`${API_BASE_URL}/api/v1/builds/${params.buildId}`, { cache: "no-store", }); if (res.status === 404) return notFound(); const build = await res.json().catch(() => null); if (!build) return notFound(); return (
← Back to Community Builds

{build.title ?? "Untitled build"}

{build.description && (

{build.description}

)}

Parts

{/* Adjust keys to match your API payload */}
{(build.items ?? build.buildItems ?? []).map((it: any) => (
{it.product?.name ?? it.name ?? "Part"}
{it.slot ?? it.partRole ?? "—"}
x{it.quantity ?? 1}
))}
); }