From 6f32bfa17fe37c754de86878b8d2293787d84af7 Mon Sep 17 00:00:00 2001 From: robin Date: Thu, 18 Dec 2025 21:38:10 +0100 Subject: [PATCH] feat: add visual eyecatcher to session detail header --- src/app/sessions/[id]/page.tsx | 88 +++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/src/app/sessions/[id]/page.tsx b/src/app/sessions/[id]/page.tsx index 083e039..860dbb9 100644 --- a/src/app/sessions/[id]/page.tsx +++ b/src/app/sessions/[id]/page.tsx @@ -35,6 +35,7 @@ interface SessionTasting { id: string; name: string; distillery: string; + image_url?: string | null; }; } @@ -83,8 +84,9 @@ export default function SessionDetailPage() { // Fetch Tastings in this session const { data: tastingData } = await supabase .from('tastings') - .select('id, rating, bottles(id, name, distillery)') - .eq('session_id', id); + .select('id, rating, bottles(id, name, distillery, image_url)') + .eq('session_id', id) + .order('created_at', { ascending: false }); setTastings((tastingData as any)?.map((t: any) => ({ id: t.id, @@ -181,36 +183,66 @@ export default function SessionDetailPage() { {/* Hero */} -
-
+
+ {/* Visual Eyecatcher: Background Glow */} + {tastings.length > 0 && tastings[0].bottles.image_url && ( +
+
+
+ )} + +
-
-
-
- - Tasting Session -
-

- {session.name} -

-
- - - {new Date(session.scheduled_at).toLocaleDateString('de-DE')} - - {participants.length > 0 && ( -
- - p.buddies.name)} limit={5} /> + +
+
+ {/* Visual Eyecatcher: Bottle Preview */} + {tastings.length > 0 && tastings[0].bottles.image_url && ( +
+
+ {tastings[0].bottles.name} +
- )} - {tastings.length > 0 && ( - - - {tastings.length} {tastings.length === 1 ? 'Whisky' : 'Whiskys'} +
+ LATEST +
+
+ )} + +
+
+ + Tasting Session +
+

+ {session.name} +

+
+ + + {new Date(session.scheduled_at).toLocaleDateString('de-DE')} - )} + {participants.length > 0 && ( +
+ + p.buddies.name)} limit={5} /> +
+ )} + {tastings.length > 0 && ( + + + {tastings.length} {tastings.length === 1 ? 'Whisky' : 'Whiskys'} + + )} +