lots of fixes. cant remember them all

This commit is contained in:
2025-12-18 09:42:25 -05:00
parent 607939c468
commit 4c2d767d09
28 changed files with 3342 additions and 996 deletions
@@ -0,0 +1,24 @@
// app/(builder)/parts/_components/buildDetailHref.ts
const toSlug = (str: string) =>
str
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/(^-|-$)/g, "");
export type BuildDetailInput = {
id: string;
name: string;
brand?: string;
};
export function buildDetailHref(
platform: string,
partRole: string,
p: BuildDetailInput
) {
const slug = toSlug(`${p.brand ?? ""} ${p.name ?? ""}`);
return `/parts/p/${encodeURIComponent(platform)}/${encodeURIComponent(
partRole
)}/${p.id}-${slug}`;
}