<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';
import { unifySlug } from '~~/shared/general';

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)
    {
        overview.value = await Content.render(element.value, path.value);
    }
});
</script>