diff --git a/src/app/profile/subscriptions/page.tsx b/src/app/profile/subscriptions/page.tsx index fd83240..62dca15 100644 --- a/src/app/profile/subscriptions/page.tsx +++ b/src/app/profile/subscriptions/page.tsx @@ -91,6 +91,16 @@ export default function ProfileSubscriptionsPage() { }) }, [subscriptions]) + const coffeeImageById = React.useMemo(() => { + const map: Record = {} + coffees.forEach((coffee) => { + if (coffee.image) { + map[String(coffee.id)] = coffee.image + } + }) + return map + }, [coffees]) + if (!hasHydrated || !isAuthReady || !user) { return (
@@ -271,9 +281,11 @@ export default function ProfileSubscriptionsPage() { }`} >
-

- {subscription.name || `Subscription #${subscription.id}`} -

+
+

+ {subscription.name || `Subscription #${subscription.id}`} +

+
@@ -397,13 +409,29 @@ export default function ProfileSubscriptionsPage() {
) : (
- {includedItems.map((item, index) => ( -
-

{item.coffeeName || `Coffee #${item.coffeeId || index + 1}`}

-

Coffee ID: {item.coffeeId || '—'}

-

Packs included: {Number(item.quantity) || 0}

-
- ))} + {includedItems.map((item, index) => { + const imageUrl = item.coffeeId ? coffeeImageById[String(item.coffeeId)] : '' + return ( +
+
+
+

{item.coffeeName || `Coffee #${item.coffeeId || index + 1}`}

+

Coffee ID: {item.coffeeId || '—'}

+

Packs included: {Number(item.quantity) || 0}

+
+ {imageUrl ? ( + {item.coffeeName + ) : ( +
+ )} +
+
+ ) + })}
)}