From f4a459a27abe0fbd40e2953a3d69e5ecbad99ecb Mon Sep 17 00:00:00 2001 From: aman333nolawz Date: Sun, 5 Jul 2026 19:42:59 +0530 Subject: feat: Add card for event details --- src/components/EventDetails.astro | 109 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 src/components/EventDetails.astro diff --git a/src/components/EventDetails.astro b/src/components/EventDetails.astro new file mode 100644 index 0000000..5923247 --- /dev/null +++ b/src/components/EventDetails.astro @@ -0,0 +1,109 @@ +--- +import Link from '@/components/Link.astro' +import { cn } from '@/lib/utils' +import { Icon } from 'astro-icon/components' + +interface Detail { + icon: string + label: string + value: string + href?: string +} + +interface EventDetailsProps { + title?: string + date?: string + time?: string + venue?: string + requirements?: string + registration?: string + organiser?: string + website?: string + details?: Detail[] + variant?: 'default' | 'compact' + class?: string +} + +const { + title, + date, + time, + venue, + requirements, + registration, + organiser, + website, + details = [], + variant = 'default', + class: className, +} = Astro.props + +const builtIns: Detail[] = [ + date && { icon: 'lucide:calendar', label: 'Date', value: date }, + time && { icon: 'lucide:clock', label: 'Time', value: time }, + venue && { icon: 'lucide:map-pin', label: 'Venue', value: venue }, + requirements && { icon: 'lucide:backpack', label: 'Requirements', value: requirements }, + registration && { icon: 'lucide:clipboard-check', label: 'Registration', value: registration, href: registration }, + organiser && { icon: 'lucide:users', label: 'Organiser', value: organiser }, + website && { icon: 'lucide:external-link', label: 'Website', value: website, href: website }, +].filter(Boolean) as Detail[] + +const allDetails = [...builtIns, ...details] +--- + +
+ { + title && ( + + + {title} + + ) + } + +
+ { + allDetails.map((detail) => ( +
+
+ + {detail.label} +
+
+ {detail.href ? ( + + {detail.value} + + ) : ( + {detail.value} + )} +
+
+ )) + } +
+ + +
-- cgit v1.2.3