Update gifts table in dashboard
This commit is contained in:
@@ -424,25 +424,61 @@ export default function GiftRegistryPage() {
|
||||
colSpan={7}
|
||||
className="py-1 px-4 border-t-0 bg-gray-50 dark:bg-gray-800/50 text-sm text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
{item.status === GiftStatus.AVAILABLE && (
|
||||
<>
|
||||
Store: {item.store_name || "N/A"} •{" "}
|
||||
{item.purchase_url
|
||||
? `URL: ${item.purchase_url}`
|
||||
: `Brand: ${item.brand || "N/A"}`}
|
||||
</>
|
||||
)}
|
||||
{item.status === GiftStatus.RESERVED && (
|
||||
<>Reserved by: John Smith on April 12, 2025</>
|
||||
)}
|
||||
{item.status === GiftStatus.PURCHASED && (
|
||||
<>Purchased by: Maria Lopez on April 10, 2025</>
|
||||
)}
|
||||
{item.status === GiftStatus.RECEIVED && (
|
||||
<>
|
||||
Received: Complete! • Brand: {item.brand || "N/A"}
|
||||
</>
|
||||
)}
|
||||
<div className="flex flex-col gap-1">
|
||||
{/* Description - show if available */}
|
||||
{item.description && <p>{item.description}</p>}
|
||||
|
||||
{/* Status-specific information */}
|
||||
<div className="flex items-center gap-2">
|
||||
{item.status === GiftStatus.AVAILABLE && (
|
||||
<>
|
||||
{item.store_name && (
|
||||
<span>Store: {item.store_name}</span>
|
||||
)}
|
||||
|
||||
{item.purchase_url && (
|
||||
<>
|
||||
{item.store_name && <span>•</span>}
|
||||
<a
|
||||
href={item.purchase_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
Shop Link
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
|
||||
{!item.store_name &&
|
||||
!item.purchase_url &&
|
||||
item.brand && (
|
||||
<span>Brand: {item.brand}</span>
|
||||
)}
|
||||
|
||||
{!item.store_name &&
|
||||
!item.purchase_url &&
|
||||
!item.brand && (
|
||||
<span className={"italic"}>
|
||||
No purchase information available
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{item.status === GiftStatus.RESERVED && (
|
||||
<span>Reserved</span>
|
||||
)}
|
||||
|
||||
{item.status === GiftStatus.PURCHASED && (
|
||||
<span>Purchased</span>
|
||||
)}
|
||||
|
||||
{item.status === GiftStatus.RECEIVED && (
|
||||
<span>Received</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</React.Fragment>
|
||||
|
||||
Reference in New Issue
Block a user