2024-11-30 02:19:32 +01:00
|
|
|
<template>
|
2025-12-09 22:32:22 +01:00
|
|
|
<ContentWarning
|
2026-01-09 23:10:45 +01:00
|
|
|
v-if="(note.sensitive || note.spoiler_text) && preferences.show_content_warning"
|
2025-12-09 22:32:22 +01:00
|
|
|
v-model="hidden"
|
|
|
|
|
/>
|
2024-12-07 15:16:45 +01:00
|
|
|
|
2025-12-09 22:32:22 +01:00
|
|
|
<OverflowGuard
|
2026-01-09 23:10:45 +01:00
|
|
|
v-if="note.content"
|
2025-12-09 22:32:22 +01:00
|
|
|
:character-count="characterCount"
|
|
|
|
|
:class="(hidden && preferences.show_content_warning) && 'hidden'"
|
|
|
|
|
>
|
2026-01-09 23:10:45 +01:00
|
|
|
<Prose v-html="note.content" v-render-emojis="note.emojis"></Prose>
|
2025-04-10 14:48:03 +02:00
|
|
|
</OverflowGuard>
|
2024-11-30 16:39:02 +01:00
|
|
|
|
2025-12-09 22:32:22 +01:00
|
|
|
<Attachments
|
2026-01-09 23:10:45 +01:00
|
|
|
v-if="note.media_attachments.length > 0"
|
|
|
|
|
:attachments="note.media_attachments"
|
2025-12-09 22:32:22 +01:00
|
|
|
:class="(hidden && preferences.show_content_warning) && 'hidden'"
|
|
|
|
|
/>
|
2024-12-01 17:56:31 +01:00
|
|
|
|
2026-01-09 23:10:45 +01:00
|
|
|
<div v-if="note.quote" class="mt-4 rounded border overflow-hidden">
|
|
|
|
|
<Note :note="note.quote" :hide-actions="true" :small-layout="true" />
|
2024-11-30 16:39:02 +01:00
|
|
|
</div>
|
2024-11-30 02:19:32 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-12-01 17:56:31 +01:00
|
|
|
import Attachments from "./attachments.vue";
|
2025-04-10 14:48:03 +02:00
|
|
|
import ContentWarning from "./content-warning.vue";
|
2024-11-30 16:39:02 +01:00
|
|
|
import Note from "./note.vue";
|
2025-04-10 14:48:03 +02:00
|
|
|
import OverflowGuard from "./overflow-guard.vue";
|
|
|
|
|
import Prose from "./prose.vue";
|
2026-01-09 23:10:45 +01:00
|
|
|
import { key } from "./provider";
|
2024-11-30 16:39:02 +01:00
|
|
|
|
2026-01-09 23:10:45 +01:00
|
|
|
// biome-ignore lint/style/noNonNullAssertion: We want an error if not provided
|
|
|
|
|
const { note } = inject(key)!;
|
2025-04-10 14:48:03 +02:00
|
|
|
|
2026-01-09 23:10:45 +01:00
|
|
|
const hidden = ref(note.sensitive || !!note.spoiler_text);
|
2024-12-02 19:30:19 +01:00
|
|
|
|
2026-01-09 23:10:45 +01:00
|
|
|
const characterCount = note.text?.length;
|
2024-11-30 02:19:32 +01:00
|
|
|
</script>
|