From 5971dfb4057d5cbf9f285813b56f8121000d5c5e Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Sun, 16 Mar 2025 18:20:45 +0100 Subject: [PATCH] Update gifts table in dashboard --- .../dashboard/events/[slug]/gifts/page.tsx | 74 ++++++++++++++----- 1 file changed, 55 insertions(+), 19 deletions(-) diff --git a/frontend/src/app/(main)/dashboard/events/[slug]/gifts/page.tsx b/frontend/src/app/(main)/dashboard/events/[slug]/gifts/page.tsx index 3568a8b..d943a34 100644 --- a/frontend/src/app/(main)/dashboard/events/[slug]/gifts/page.tsx +++ b/frontend/src/app/(main)/dashboard/events/[slug]/gifts/page.tsx @@ -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"} - - )} +
+ {/* Description - show if available */} + {item.description &&

{item.description}

} + + {/* Status-specific information */} +
+ {item.status === GiftStatus.AVAILABLE && ( + <> + {item.store_name && ( + Store: {item.store_name} + )} + + {item.purchase_url && ( + <> + {item.store_name && } + + Shop Link + + + )} + + {!item.store_name && + !item.purchase_url && + item.brand && ( + Brand: {item.brand} + )} + + {!item.store_name && + !item.purchase_url && + !item.brand && ( + + No purchase information available + + )} + + )} + + {item.status === GiftStatus.RESERVED && ( + Reserved + )} + + {item.status === GiftStatus.PURCHASED && ( + Purchased + )} + + {item.status === GiftStatus.RECEIVED && ( + Received + )} +
+