2023-10-10 03:43:43 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-10-10 03:43:43 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header>
|
|
|
|
<MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/>
|
|
|
|
</template>
|
|
|
|
|
2024-01-18 10:21:33 +01: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 03:43:43 +02: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 10:21:33 +01:00
|
|
|
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
|
2023-10-10 03:43:43 +02: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,
|
|
|
|
icon: 'ti ti-info-circle',
|
|
|
|
}, {
|
|
|
|
key: 'notes',
|
|
|
|
title: i18n.ts._fileViewer.attachedNotes,
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
}]);
|
|
|
|
|
2024-02-16 08:17:09 +01:00
|
|
|
definePageMetadata(() => ({
|
2023-10-10 03:43:43 +02:00
|
|
|
title: i18n.ts._fileViewer.title,
|
|
|
|
icon: 'ti ti-file',
|
2024-02-16 08:17:09 +01:00
|
|
|
}));
|
2023-10-10 03:43:43 +02:00
|
|
|
</script>
|