all repos — website @ 947a98b4c5acbe89dffc467f5fd1e30f1cd6653e

My official website.

src/components/Link.astro (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
---
import { cn } from '@/lib/utils'

type 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>