import { notFound } from "next/navigation"; import { prisma } from "@/lib/prisma"; import AssemblyDetailClient from "./AssemblyDetailClient"; export const dynamic = "force-dynamic"; export default async function AdminAssemblyDetailPage({ params, }: { params: Promise<{ id: string; assemblyId: string }>; }) { const { id, assemblyId } = await params; const assembly = await prisma.assembly.findFirst({ where: { id: assemblyId, projectId: id }, include: { project: { select: { id: true, code: true, name: true } }, parts: { orderBy: { code: "asc" }, include: { _count: { select: { operations: true } }, stepFile: { select: { id: true } }, drawingFile: { select: { id: true } }, cutFile: { select: { id: true } }, }, }, }, }); if (!assembly) notFound(); return ( ({ id: p.id, code: p.code, name: p.name, material: p.material, qty: p.qty, hasStep: !!p.stepFile, hasDrawing: !!p.drawingFile, hasCut: !!p.cutFile, operationCount: p._count.operations, }))} /> ); }