2023-07-27 14:31:52 +09:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 14:31:52 +09:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
-->
|
|
|
|
|
|
2020-11-15 13:42:04 +09:00
|
|
|
<template>
|
2024-03-18 18:21:27 +09:00
|
|
|
<div :class="$style.root">
|
|
|
|
|
<MkNote v-if="note && !block.detailed" :key="note.id + ':normal'" :note="note"/>
|
|
|
|
|
<MkNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" :note="note"/>
|
2020-11-15 13:42:04 +09:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2023-05-14 10:50:21 +09:00
|
|
|
<script lang="ts" setup>
|
2023-12-26 14:19:35 +09:00
|
|
|
import { onMounted, ref } from 'vue';
|
2023-05-14 10:50:21 +09:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-03-31 14:14:30 +09:00
|
|
|
import MkNote from '@/components/MkNote.vue';
|
|
|
|
|
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
2024-01-04 18:32:46 +09:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2020-11-15 13:42:04 +09:00
|
|
|
|
2023-05-14 10:50:21 +09:00
|
|
|
const props = defineProps<{
|
2024-01-30 19:53:53 +09:00
|
|
|
block: Misskey.entities.PageBlock,
|
2023-05-14 10:50:21 +09:00
|
|
|
page: Misskey.entities.Page,
|
|
|
|
|
}>();
|
2021-01-30 10:59:05 +09:00
|
|
|
|
2023-12-26 14:19:35 +09:00
|
|
|
const note = ref<Misskey.entities.Note | null>(null);
|
2021-01-30 10:59:05 +09:00
|
|
|
|
2023-05-14 10:50:21 +09:00
|
|
|
onMounted(() => {
|
2024-01-30 19:53:53 +09:00
|
|
|
if (props.block.note == null) return;
|
2024-01-04 18:32:46 +09:00
|
|
|
misskeyApi('notes/show', { noteId: props.block.note })
|
2023-05-14 10:50:21 +09:00
|
|
|
.then(result => {
|
|
|
|
|
note.value = result;
|
|
|
|
|
});
|
2020-11-15 13:42:04 +09:00
|
|
|
});
|
|
|
|
|
</script>
|
2024-03-18 18:21:27 +09:00
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
|
.root {
|
|
|
|
|
border: 1px solid var(--divider);
|
|
|
|
|
border-radius: var(--radius);
|
|
|
|
|
}
|
|
|
|
|
</style>
|