<template>
    <div class="flex flex-1 justify-start items-start" ref="element">
        <Head>
            <Title>d[any] - {{ overview?.title ?? "Erreur" }}</Title>
        </Head>
    </div>
</template>

<script setup lang="ts">
import { Content } from '#shared/content.util';
import { unifySlug } from '#shared/general.util';

const element = useTemplateRef('element'), overview = ref();
const route = useRouter().currentRoute;
const path = computed(() => unifySlug(route.value.params.path));

onMounted(async () => {
	if(element.value && path.value && await Content.ready)
    {
        overview.value = Content.render(element.value, path.value);
    }
});
</script>