feat(ui): show price in public view and admin item card; fix quantity badge in claims list
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled

- Public wishlist page now displays item price (formatted as BRL) below the
  item name when a price is set
- Admin ItemCard shows price and quantity badge so items can be scanned at a
  glance without opening the edit form
- Claims list no longer shows "· 1 un." for single-unit items (the unit count
  is only displayed when item.quantity > 1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano Belisario
2026-05-03 21:13:45 +00:00
parent 3df9a67b97
commit 5548f5000f
2 changed files with 19 additions and 1 deletions

View File

@@ -221,6 +221,11 @@ function PublicWishlistContent() {
<h3 className="text-2xl font-bold text-gray-900 dark:text-white mb-1"> <h3 className="text-2xl font-bold text-gray-900 dark:text-white mb-1">
{item.name} {item.name}
</h3> </h3>
{item.price != null && (
<p className="text-lg font-semibold text-indigo-600 dark:text-indigo-400 mb-1">
{new Intl.NumberFormat('pt-BR', { style: 'currency', currency: item.currency || 'BRL' }).format(item.price)}
</p>
)}
{showQuantitySummary && ( {showQuantitySummary && (
<p className="text-sm text-gray-500 dark:text-gray-400 mb-3"> <p className="text-sm text-gray-500 dark:text-gray-400 mb-3">
{item.claimedQuantity} de {item.quantity} reservados {item.claimedQuantity} de {item.quantity} reservados
@@ -242,7 +247,9 @@ function PublicWishlistContent() {
<li key={c.id} className="flex items-center justify-between gap-2"> <li key={c.id} className="flex items-center justify-between gap-2">
<div> <div>
<span className="font-medium">{isMine ? 'Você' : 'Reservado'}</span> <span className="font-medium">{isMine ? 'Você' : 'Reservado'}</span>
<span className="text-gray-500"> · {c.quantity} un.</span> {item.quantity > 1 && (
<span className="text-gray-500"> · {c.quantity} un.</span>
)}
{c.note && isMine && ( {c.note && isMine && (
<span className="block text-xs italic text-gray-500"> <span className="block text-xs italic text-gray-500">
&quot;{c.note}&quot; &quot;{c.note}&quot;

View File

@@ -64,6 +64,17 @@ export default function ItemCard({
<h5 className="text-base font-semibold text-gray-900 dark:text-white"> <h5 className="text-base font-semibold text-gray-900 dark:text-white">
{item.name} {item.name}
</h5> </h5>
{item.price != null && (
<p className="text-sm text-indigo-600 dark:text-indigo-400 mt-0.5">
{new Intl.NumberFormat('pt-BR', { style: 'currency', currency: item.currency || 'BRL' }).format(item.price)}
{item.quantity > 1 && ` · Qtd: ${item.quantity}`}
</p>
)}
{item.price == null && item.quantity > 1 && (
<p className="text-sm text-gray-500 dark:text-gray-400 mt-0.5">
Qtd: {item.quantity}
</p>
)}
{item.description && ( {item.description && (
<p className="text-base text-gray-600 dark:text-gray-400 mt-1"> <p className="text-base text-gray-600 dark:text-gray-400 mt-1">
{item.description} {item.description}