2024-11-30 02:19:32 +01:00
|
|
|
<template>
|
2025-12-09 22:32:22 +01:00
|
|
|
<ContentWarning
|
|
|
|
|
v-if="(sensitive || contentWarning) && preferences.show_content_warning"
|
|
|
|
|
:content-warning="contentWarning"
|
|
|
|
|
:character-count="characterCount ?? 0"
|
|
|
|
|
:attachment-count="attachments.length"
|
|
|
|
|
v-model="hidden"
|
|
|
|
|
/>
|
2024-12-07 15:16:45 +01:00
|
|
|
|
2025-12-09 22:32:22 +01:00
|
|
|
<OverflowGuard
|
|
|
|
|
v-if="content"
|
|
|
|
|
:character-count="characterCount"
|
|
|
|
|
:class="(hidden && preferences.show_content_warning) && 'hidden'"
|
|
|
|
|
>
|
2025-04-10 14:48:03 +02:00
|
|
|
<Prose v-html="content" v-render-emojis="emojis"></Prose>
|
|
|
|
|
</OverflowGuard>
|
2024-11-30 16:39:02 +01:00
|
|
|
|
2025-12-09 22:32:22 +01:00
|
|
|
<Attachments
|
|
|
|
|
v-if="attachments.length > 0"
|
|
|
|
|
:attachments="attachments"
|
|
|
|
|
:class="(hidden && preferences.show_content_warning) && 'hidden'"
|
|
|
|
|
/>
|
2024-12-01 17:56:31 +01:00
|
|
|
|
2024-11-30 19:15:23 +01:00
|
|
|
<div v-if="quote" class="mt-4 rounded border overflow-hidden">
|
2025-12-09 22:32:22 +01:00
|
|
|
<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>
|
2025-05-26 11:19:15 +02:00
|
|
|
import type { Attachment, CustomEmoji, Status } from "@versia/client/schemas";
|
|
|
|
|
import type { z } from "zod";
|
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";
|
2024-11-30 16:39:02 +01:00
|
|
|
|
2024-12-07 15:16:45 +01:00
|
|
|
const { content, plainContent, sensitive, contentWarning } = defineProps<{
|
2024-12-02 19:30:19 +01:00
|
|
|
plainContent?: string;
|
2024-11-30 02:19:32 +01:00
|
|
|
content: string;
|
2025-05-26 11:19:15 +02:00
|
|
|
quote?: NonNullable<z.infer<typeof Status.shape.quote>>;
|
|
|
|
|
emojis: z.infer<typeof CustomEmoji>[];
|
|
|
|
|
attachments: z.infer<typeof Attachment>[];
|
2024-12-07 15:16:45 +01:00
|
|
|
sensitive: boolean;
|
|
|
|
|
contentWarning?: string;
|
2024-11-30 02:19:32 +01:00
|
|
|
}>();
|
2025-04-10 14:48:03 +02:00
|
|
|
|
2025-11-21 12:16:00 +01:00
|
|
|
const hidden = ref(sensitive || !!contentWarning);
|
2024-12-02 19:30:19 +01:00
|
|
|
|
|
|
|
|
const characterCount = plainContent?.length;
|
2024-11-30 02:19:32 +01:00
|
|
|
</script>
|