---
import { cn } from '@lib/utils'

type Props = {
  href: string
  external?: boolean
  class?: string
  'data-heading'?: string
}

const { href, external, class: className, 'data-heading': dataHeading, ...rest } = Astro.props
---

<a
  href={href}
  target={external ? '_blank' : '_self'}
  class={cn(
    'inline-block transition-colors duration-300 ease-in-out hover:underline underline-offset-[3px]',
    className
  )}
  data-heading={dataHeading}
  {...rest}
>
  <slot />
</a>