a metric shit ton. fixed a lot of part_role issues. removed almost all hardcoded categories and used db roles.

This commit is contained in:
2025-12-15 20:59:19 -05:00
parent 0f10ff4e09
commit 607939c468
16 changed files with 1538 additions and 1065 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ export function BuilderNav({ activeCategoryId }: BuilderNavProps) {
const currentCategory =
activeCategoryId ?? searchParams.get("category") ?? undefined;
const baseHref = "/builder";
const baseHref = "/parts";
const renderDropdown = (label: string, items: Category[]) => {
if (!items.length) return null;
@@ -71,10 +71,10 @@ export function BuilderNav({ activeCategoryId }: BuilderNavProps) {
return (
<div className="max-w-6xl mx-auto w-full"> {/* ← aligns with topnav */}
<nav className="flex items-center gap-6 border-b border-neutral-900 px-6 py-3 text-sm bg-black/95 backdrop-blur-sm">
<nav className="flex items-center gap-6 border-b border-neutral-900 px-6 py-3 text-sm backdrop-blur-sm">
{/* Primary builder link */}
<Link
href={baseHref}
href={'/builder'}
className="font-semibold text-neutral-100 hover:text-white tracking-[0.25em] uppercase text-[11px]"
>
Builder
-87
View File
@@ -1,87 +0,0 @@
"use client";
import Link from "next/link";
import type { Category, Part } from "@/types/gunbuilder";
import { PartCard } from "@/components/PartCard";
interface CategoryColumnProps {
category: Category;
parts: Part[];
selectedPartId?: string;
onSelectPart: (partId: string) => void;
platform?: string;
}
export function CategoryColumn({
category,
parts,
selectedPartId,
onSelectPart,
platform,
}: CategoryColumnProps) {
// Show selected part if available, otherwise show placeholder
const displayedPart = selectedPartId
? parts.find((p) => p.id === selectedPartId)
: null;
return (
<div className="flex flex-col h-full">
<div className="mb-3">
<h2 className="text-xs font-semibold tracking-[0.15em] text-zinc-400 uppercase">
{category.name}
</h2>
</div>
<div className="flex-1 overflow-y-auto pr-1">
{parts.length === 0 && (
<p className="text-xs text-zinc-500">No parts available yet.</p>
)}
{!displayedPart && parts.length > 0 && (
<div className="w-full border border-zinc-700 rounded-md p-3 mb-2 flex items-center justify-between gap-3">
<p className="text-sm text-zinc-500">No part selected</p>
<Link
href={{
pathname: `/builder/${category.id}`,
query: platform ? { platform } : {},
}}
className="inline-flex w-full items-center justify-center rounded-md border border-zinc-700 bg-zinc-900 px-4 py-2 text-xs font-semibold text-zinc-100 hover:bg-zinc-800 hover:border-zinc-600 transition-colors"
>
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M12 4v16m8-8H4"
/>
</svg>
Choose a Part
</Link>
</div>
)}
{displayedPart && (
<PartCard
key={displayedPart.id}
part={displayedPart}
selected={displayedPart.id === selectedPartId}
onSelect={() => onSelectPart(displayedPart.id)}
/>
)}
</div>
{parts.length >= 1 && (
<Link
href={{
pathname: `/builder/${category.id}`,
query: platform ? { platform } : {},
}}
className="mt-2 w-full rounded-md border border-zinc-700 bg-zinc-900/50 px-3 py-2 text-xs font-medium text-zinc-300 hover:bg-zinc-800 hover:border-zinc-600 transition-colors text-center"
>
View All ({parts.length})
</Link>
)}
</div>
);
}
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import type { PriceHistoryPoint } from "@/app/(builder)/builder/[categoryId]/[partId]/data";
import type { PriceHistoryPoint } from "@/app/(builder)/parts/[category]/[partId]/data";
interface PricingHistoryGraphProps {
data: PriceHistoryPoint[];
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import type { RetailerOffer } from "@/app/(builder)/builder/[categoryId]/[partId]/data";
import type { RetailerOffer } from "@/app/(builder)/parts/[category]/[partId]/data";
interface RetailersListProps {
retailers: RetailerOffer[];