part cards
This commit is contained in:
@@ -17,10 +17,10 @@ export function CategoryColumn({
|
||||
selectedPartId,
|
||||
onSelectPart,
|
||||
}: CategoryColumnProps) {
|
||||
// Show selected part if available, otherwise show first part
|
||||
// Show selected part if available, otherwise show placeholder
|
||||
const displayedPart = selectedPartId
|
||||
? parts.find((p) => p.id === selectedPartId) || parts[0]
|
||||
: parts[0];
|
||||
? parts.find((p) => p.id === selectedPartId)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
@@ -33,6 +33,11 @@ export function CategoryColumn({
|
||||
{parts.length === 0 && (
|
||||
<p className="text-xs text-zinc-500">No parts yet for this category.</p>
|
||||
)}
|
||||
{!displayedPart && parts.length > 0 && (
|
||||
<div className="w-full border border-zinc-700 rounded-md p-3 mb-2 text-center">
|
||||
<p className="text-sm text-zinc-500">Choose a Part</p>
|
||||
</div>
|
||||
)}
|
||||
{displayedPart && (
|
||||
<PartCard
|
||||
key={displayedPart.id}
|
||||
|
||||
Reference in New Issue
Block a user