<!--
SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<XNoteDetailed
	ref="rootEl"
	:note="note"
	:initialTab="initialTab"
	:expandAllCws="expandAllCws"
/>
</template>

<script setup lang="ts">
import * as Misskey from 'misskey-js';
import { computed, defineAsyncComponent, shallowRef } from 'vue';
import type { ComponentExposed } from 'vue-component-type-helpers';
import type MkNoteDetailed from '@/components/MkNoteDetailed.vue';
import type SkNoteDetailed from '@/components/SkNoteDetailed.vue';
import { prefer } from '@/preferences';

const XNoteDetailed = computed(() =>
	defineAsyncComponent(() =>
		prefer.r.noteDesign.value === 'misskey'
			? import('@/components/MkNoteDetailed.vue')
			: import('@/components/SkNoteDetailed.vue'),
	),
);

const rootEl = shallowRef<ComponentExposed<typeof MkNoteDetailed | typeof SkNoteDetailed>>();

defineExpose({ rootEl });

defineProps<{
	note: Misskey.entities.Note;
	initialTab?: string;
	expandAllCws?: boolean;
}>();
</script>
