---
import type { HTMLAttributes } from "astro/types"
import { classMerge } from "~ui/utils/classMerge"

interface Props {
  title?: string
  href: string
  newTab?: boolean
  class?: string
  restProps?: HTMLAttributes<"a">
}
const p = Astro.props
const title = p.title
const href = p.href
const newTab = p.newTab
---

<a
  href={href}
  class={classMerge("text-blue-500 no-underline hover:underline", p.class)}
  target={newTab ? "_blank" : undefined}
  title={title}
  {...p.restProps}
>
  <slot />
</a>
