"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; } export function CategoryColumn({ category, parts, selectedPartId, onSelectPart, }: CategoryColumnProps) { // Show selected part if available, otherwise show placeholder const displayedPart = selectedPartId ? parts.find((p) => p.id === selectedPartId) : null; return (

{category.name}

{parts.length === 0 && (

No parts available yet.

)} {!displayedPart && parts.length > 0 && (

No part selected

Choose a Part
)} {displayedPart && ( onSelectPart(displayedPart.id)} /> )}
{parts.length >= 1 && ( View All ({parts.length}) )}
); }