<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';

const element = useTemplateRef('element'), overview = ref();
const route = useRouter().currentRoute;
const path = computed(() => Array.isArray(route.value.params.path) ? route.value.params.path[0] : route.value.params.path);

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