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