2024-04-22 09:38:51 +02:00
|
|
|
<template>
|
2024-06-10 06:33:14 +02:00
|
|
|
<article
|
2024-07-22 01:23:29 +02:00
|
|
|
class="first:rounded-t last:rounded-b ring-1 relative ring-white/5 p-6 flex flex-col bg-dark-800 hover:bg-dark-700 duration-200">
|
2024-04-28 08:35:26 +02:00
|
|
|
<!-- Overlay that blocks clicks for disabled notes -->
|
|
|
|
|
<div v-if="disabled" class="absolute z-10 inset-0 hover:cursor-not-allowed">
|
|
|
|
|
</div>
|
2024-06-16 03:42:48 +02:00
|
|
|
<div v-if="reblog" class="mb-4 flex flex-row gap-2 items-center text-primary-400">
|
2024-04-28 07:02:27 +02:00
|
|
|
<Skeleton :enabled="!loaded" shape="rect" class="!h-6" :min-width="40" :max-width="100" width-unit="%">
|
2024-05-12 11:04:00 +02:00
|
|
|
<iconify-icon width="1.5rem" height="1.5rem" icon="tabler:repeat" class="size-6" aria-hidden="true" />
|
2024-06-21 04:09:09 +02:00
|
|
|
<Avatar v-if="reblog.avatar" :src="reblog.avatar" :alt="`${reblog.acct}'s avatar'`"
|
2024-05-12 10:37:57 +02:00
|
|
|
class="size-6 rounded shrink-0 ring-1 ring-white/10" />
|
2024-04-28 07:02:27 +02:00
|
|
|
<span><strong v-html="reblogDisplayName"></strong> reblogged</span>
|
2024-04-22 09:38:51 +02:00
|
|
|
</Skeleton>
|
|
|
|
|
</div>
|
2024-06-21 04:09:09 +02:00
|
|
|
<ReplyHeader v-if="isReply" :account_id="outputtedNote?.in_reply_to_account_id ?? null" />
|
|
|
|
|
<Header :note="outputtedNote" :small="small" />
|
|
|
|
|
<NoteContent :note="outputtedNote" :loaded="loaded" :url="url" :content="content" :is-quote="isQuote"
|
|
|
|
|
:should-hide="shouldHide" />
|
2024-06-29 05:05:50 +02:00
|
|
|
<Skeleton class="!h-10 w-full mt-6" :enabled="!props.element || !loaded" v-if="!small || !showInteractions">
|
2024-11-04 22:18:53 +01:00
|
|
|
<InteractionRow v-if="showInteractions && outputtedNote" :note="outputtedNote" :url="url" :remove="remove" />
|
2024-04-28 08:35:26 +02:00
|
|
|
</Skeleton>
|
2024-06-10 06:33:14 +02:00
|
|
|
</article>
|
2024-04-22 09:38:51 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-11-04 22:18:53 +01:00
|
|
|
import type { Status } from "@versia/client/types";
|
2024-06-21 04:09:09 +02:00
|
|
|
import Avatar from "~/components/avatars/avatar.vue";
|
2024-04-22 09:38:51 +02:00
|
|
|
import Skeleton from "~/components/skeleton/Skeleton.vue";
|
2024-06-21 04:09:09 +02:00
|
|
|
import Header from "./header.vue";
|
2024-11-04 22:18:53 +01:00
|
|
|
import InteractionRow from "./interactions/row.vue";
|
2024-06-21 04:09:09 +02:00
|
|
|
import NoteContent from "./note-content.vue";
|
|
|
|
|
import ReplyHeader from "./reply-header.vue";
|
2024-04-22 09:38:51 +02:00
|
|
|
|
2024-04-28 08:35:26 +02:00
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
2024-06-29 05:05:50 +02:00
|
|
|
element?: Status;
|
2024-04-28 08:35:26 +02:00
|
|
|
small?: boolean;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
showInteractions?: boolean;
|
|
|
|
|
}>(),
|
|
|
|
|
{
|
|
|
|
|
showInteractions: true,
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-04-22 09:38:51 +02:00
|
|
|
|
2024-06-29 05:05:50 +02:00
|
|
|
const noteRef = ref(props.element);
|
2024-06-05 02:03:15 +02:00
|
|
|
|
2024-06-06 08:42:44 +02:00
|
|
|
useListen("composer:send-edit", (note) => {
|
|
|
|
|
if (note.id === noteRef.value?.id) {
|
|
|
|
|
noteRef.value = note;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-28 07:02:27 +02:00
|
|
|
const {
|
|
|
|
|
loaded,
|
2024-06-06 08:42:44 +02:00
|
|
|
note: outputtedNote,
|
2024-04-28 07:02:27 +02:00
|
|
|
remove,
|
|
|
|
|
content,
|
|
|
|
|
shouldHide,
|
|
|
|
|
url,
|
2024-04-28 08:35:26 +02:00
|
|
|
isQuote,
|
2024-04-28 07:02:27 +02:00
|
|
|
reblog,
|
2024-05-12 04:33:40 +02:00
|
|
|
isReply,
|
2024-04-28 07:02:27 +02:00
|
|
|
reblogDisplayName,
|
2024-06-19 08:16:28 +02:00
|
|
|
} = useNoteData(noteRef, client, settings);
|
2024-05-12 04:15:42 +02:00
|
|
|
</script>
|