mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
25 lines
420 B
Svelte
25 lines
420 B
Svelte
<script lang="ts">
|
|
import {goto} from "$app/navigation"
|
|
|
|
export let href
|
|
export let external = false
|
|
|
|
const go = (e: Event) => {
|
|
if (!external) {
|
|
e.preventDefault()
|
|
|
|
goto(href)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<a
|
|
{href}
|
|
{...$$props}
|
|
on:click|stopPropagation={go}
|
|
class="cursor-pointer {$$props.class}"
|
|
rel={external ? "noopener noreferer" : ""}
|
|
target={external ? "_blank" : ""}>
|
|
<slot />
|
|
</a>
|