20 lines
365 B
Text
20 lines
365 B
Text
---
|
|
import type { HTMLAttributes } from "astro/types";
|
|
|
|
interface Props extends HTMLAttributes<"a"> {
|
|
href: string;
|
|
external?: boolean;
|
|
class?: string;
|
|
}
|
|
|
|
const { href, external = true, ...rest } = Astro.props;
|
|
---
|
|
|
|
<a
|
|
href={href}
|
|
rel={external ? "noopener nofollow noreferrer" : ""}
|
|
target={external ? "_blank" : "_self"}
|
|
{...rest}
|
|
>
|
|
<slot />
|
|
</a>
|