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

<script setup lang="ts">
import { parseURL } from 'ufo';
import proses, { fakeA } 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', fakeA, [ text(label) ], { href }) as HTMLElement);
	});
});
</script>