2023-10-10 10:43:43 +09:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header>
|
|
|
|
<MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/>
|
|
|
|
</template>
|
|
|
|
|
2024-01-18 18:21:33 +09:00
|
|
|
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
|
|
|
|
<MkSpacer v-if="tab === 'info'" key="info" :contentMax="800">
|
|
|
|
<XFileInfo :fileId="fileId"/>
|
|
|
|
</MkSpacer>
|
|
|
|
|
|
|
|
<MkSpacer v-else-if="tab === 'notes'" key="notes" :contentMax="800">
|
|
|
|
<XNotes :fileId="fileId"/>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkHorizontalSwipe>
|
2023-10-10 10:43:43 +09:00
|
|
|
</MkStickyContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed, ref, defineAsyncComponent } from 'vue';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2024-01-18 18:21:33 +09:00
|
|
|
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
|
2023-10-10 10:43:43 +09:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
fileId: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const XFileInfo = defineAsyncComponent(() => import('./drive.file.info.vue'));
|
|
|
|
const XNotes = defineAsyncComponent(() => import('./drive.file.notes.vue'));
|
|
|
|
|
|
|
|
const tab = ref('info');
|
|
|
|
|
|
|
|
const headerActions = computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = computed(() => [{
|
|
|
|
key: 'info',
|
|
|
|
title: i18n.ts.info,
|
2023-10-14 02:07:41 +09:00
|
|
|
icon: 'ph-info ph-bold ph-lg',
|
2023-10-10 10:43:43 +09:00
|
|
|
}, {
|
|
|
|
key: 'notes',
|
|
|
|
title: i18n.ts._fileViewer.attachedNotes,
|
2024-02-05 20:39:15 +09:00
|
|
|
icon: 'ph-pencil-simple ph-bold ph-lg',
|
2023-10-10 10:43:43 +09:00
|
|
|
}]);
|
|
|
|
|
|
|
|
definePageMetadata(computed(() => ({
|
|
|
|
title: i18n.ts._fileViewer.title,
|
2023-10-14 02:07:41 +09:00
|
|
|
icon: 'ph-file-text ph-bold ph-lg',
|
2023-10-10 10:43:43 +09:00
|
|
|
})));
|
|
|
|
</script>
|