import { addKitComponent, buildAssembly } from "@/lib/actions"; import { getAssembliesWithComponents, getParts } from "@/lib/repository"; export default function AssembliesPage() { const parts = getParts(); const assemblies = parts.filter((part) => part.kind === "assembly"); const components = parts.filter((part) => part.kind === "part"); const kitRows = getAssembliesWithComponents(); return (

Bill of Materials

Define which stocked parts are consumed to build each assembly.

Build Assembly

Consume component stock and create finished kit inventory in one transaction flow.

Current Assemblies

{kitRows.length === 0 ? ( ) : ( kitRows.map((row, index) => ( )) )}
AssemblyNameComponentComponent NameQty Per
Add an assembly on the Parts page, then define its bill of materials here.
{row.assemblySku}{row.assemblyName}{row.componentSku}{row.componentName}{row.quantity}
); }