<script lang="ts">
	import { type LinkHref, type LinkReferrer, type LinkTarget, type LinkText, type LinkUnderline } from "$lib/types/link"
    import Code from "./code.svelte";
	
	export let link: LinkHref;
	export let text: LinkText;
	export let target: LinkTarget = '_self';
	export let referrer: LinkReferrer = 'no-referrer';
	export let underline: LinkUnderline = undefined;
	export let asCode: boolean = false;
</script>
<a href={link} target="{target}" referrerpolicy="{referrer}" class:hover:underline={underline === 'hover'} class:underline={underline === true} >
	{#if asCode}
		<Code>{text}</Code>
	{:else}
		{text}
	{/if}
</a>
