diff options
| author | nolawz <amananudhiu@gmail.com> | 2026-03-03 04:04:23 +0530 |
|---|---|---|
| committer | nolawz <amananudhiu@gmail.com> | 2026-03-03 04:04:23 +0530 |
| commit | 45026eee4c93bbbe6141dd23a664abe6e9ff3ca2 (patch) | |
| tree | 3d5762cb539d88cf1fc464ab07f9ecd49182ad08 /src/components/EventNavigation.astro | |
| parent | d41eff9eccf66644c4c60f53cb516bf079937a28 (diff) | |
Added events section and components required for that
Diffstat (limited to 'src/components/EventNavigation.astro')
| -rw-r--r-- | src/components/EventNavigation.astro | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/components/EventNavigation.astro b/src/components/EventNavigation.astro new file mode 100644 index 0000000..f1b76ce --- /dev/null +++ b/src/components/EventNavigation.astro @@ -0,0 +1,54 @@ +--- +import Link from '@/components/Link.astro' +import { buttonVariants } from '@/components/ui/button' +import { cn } from '@/lib/utils' +import { Icon } from 'astro-icon/components' + +const { newerEvent, olderEvent } = Astro.props +--- + +<nav class={cn('col-start-2 grid grid-cols-1 gap-4', 'sm:grid-cols-2')}> + <Link + href={olderEvent ? `/events/${olderEvent.id}#event-title` : '#'} + class={cn( + buttonVariants({ variant: 'outline' }), + 'rounded-lg group flex items-center justify-start size-full', + !olderEvent && 'pointer-events-none opacity-50 cursor-not-allowed', + )} + aria-disabled={!olderEvent} + > + <Icon + name="lucide:arrow-left" + class="mr-2 size-4 transition-transform group-hover:-translate-x-1" + /> + <div class="flex flex-col items-start overflow-hidden text-wrap"> + <span class="text-muted-foreground text-left text-xs"> + Previous Event + </span> + <span class="w-full text-left text-sm text-balance text-ellipsis"> + {olderEvent?.data.title || "You're at the oldest event!"} + </span> + </div> + </Link> + + <Link + href={newerEvent ? `/events/${newerEvent.id}#event-title` : '#'} + class={cn( + buttonVariants({ variant: 'outline' }), + 'rounded-lg group flex items-center justify-end size-full', + !newerEvent && 'pointer-events-none opacity-50 cursor-not-allowed', + )} + aria-disabled={!newerEvent} + > + <div class="flex flex-col items-end overflow-hidden text-wrap"> + <span class="text-muted-foreground text-right text-xs"> Next Event </span> + <span class="w-full text-right text-sm text-balance text-ellipsis"> + {newerEvent?.data.title || "You're at the newest event!"} + </span> + </div> + <Icon + name="lucide:arrow-right" + class="ml-2 size-4 transition-transform group-hover:translate-x-1" + /> + </Link> +</nav> |
