<template>
	<span ref="container"></span>
</template>

<script setup lang="ts">
import { parseURL } from 'ufo';
import proses, { preview } from '#shared/proses';
import { text } from '#shared/dom.util';

const { href, label } = defineProps<{
	href: string,
	label: string
}>();

const container = useTemplateRef('container');

onMounted(() => {
	queueMicrotask(() => {
		container.value && container.value.appendChild(proses('a', preview, [ text(label) ], { href }) as HTMLElement);
	});
});
</script>