aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Link.astro
diff options
context:
space:
mode:
authoraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
committeraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
commitd41eff9eccf66644c4c60f53cb516bf079937a28 (patch)
tree248a0863a3181369f943d678ec4273911d35efac /src/components/Link.astro
Using astro-erudite for static site generation
Diffstat (limited to 'src/components/Link.astro')
-rw-r--r--src/components/Link.astro27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/components/Link.astro b/src/components/Link.astro
new file mode 100644
index 0000000..6d434b1
--- /dev/null
+++ b/src/components/Link.astro
@@ -0,0 +1,27 @@
+---
+import { cn } from '@/lib/utils'
+
+interface Props {
+ href: string
+ external?: boolean
+ class?: string
+ underline?: boolean
+ [key: string]: any
+}
+
+const { href, external, class: className, underline, ...rest } = Astro.props
+---
+
+<a
+ href={href}
+ target={external ? '_blank' : '_self'}
+ class={cn(
+ 'inline-block transition-colors duration-300 ease-in-out',
+ underline &&
+ 'underline decoration-muted-foreground underline-offset-[3px] hover:decoration-foreground',
+ className,
+ )}
+ {...rest}
+>
+ <slot />
+</a>