Skip to content

Commit 2c88923

Browse files
Only display unallocate button if item is already allocated
1 parent d5c681e commit 2c88923

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎src/components/LineItemChip.tsx‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,14 @@ export default function LineItemChip({
134134
</p>
135135
</button>
136136
))}
137-
<button
138-
onClick={unallocateItem}
139-
className="text-left px-2 py-1 hover:bg-red-100 rounded transition-all duration-200"
140-
>
141-
{item.allocation ? "Unallocate" : "None"}
142-
</button>
137+
{item.allocation && (
138+
<button
139+
onClick={unallocateItem}
140+
className="text-left px-2 py-1 hover:bg-red-100 rounded transition-all duration-200"
141+
>
142+
Unallocate
143+
</button>
144+
)}
143145
</div>
144146
</div>
145147
</div>

0 commit comments

Comments
 (0)