martials.no/src/components/links/ExternalLink.astro

13 lines
303 B
Plaintext
Raw Normal View History

2024-09-25 22:20:47 +02:00
---
import type { LinkProps } from "@/types/props"
interface Props extends LinkProps {
noStyle?: boolean
2024-09-25 22:20:47 +02:00
}
const { href, noStyle = false, class: clazz, ...props } = Astro.props
2024-09-25 22:20:47 +02:00
---
<a href={href} target="_blank" rel="noopener" class:list={[noStyle ? "" : "link", clazz]} {...props}>
2024-09-25 22:20:47 +02:00
<slot />
</a>