+
+
+
+ reblogged
-
-
-
-
- {{
- note?.account.display_name }}
-
-
-
-
- {{ timeAgo }}
-
-
+
+
+
+
+
+
+
-
-
- @{{
- note?.account.acct
- }}
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+ This note was tagged as containing sensitive
+ content
+
+ {{ note.spoiler_text
+ }}
+ Show content
+
+
+
@@ -94,20 +86,22 @@ import type { Status } from "~/types/mastodon/status";
const props = defineProps<{
note?: Status;
- skeleton?: boolean;
+ small?: boolean;
}>();
-const isLoading = props.skeleton;
-const timeAgo = useTimeAgo(props.note?.created_at ?? 0);
+// Handle reblogs
+const note = computed(() => props.note?.reblog ?? props.note);
+const noteClosed = ref(note.value?.sensitive || !!note.value?.spoiler_text || false);
const { copy } = useClipboard();
-const client = await useMegalodon();
-const mentions = await useResolveMentions(props.note?.mentions ?? [], client);
+const client = useMegalodon();
+const mentions = await useResolveMentions(note.value?.mentions ?? [], client);
+const eventualReblogAccountName = props.note?.reblog ? (useParsedContent(props.note?.account.display_name, props.note?.account.emojis, mentions.value)).value : null;
const content =
- props.note && process.client
- ? await useParsedContent(
- props.note.content,
- props.note.emojis,
+ note.value && process.client
+ ? useParsedContent(
+ note.value.content,
+ note.value.emojis,
mentions.value,
)
: "";
@@ -117,9 +111,8 @@ const numberFormat = (number = 0) =>
compactDisplay: "short",
maximumFractionDigits: 1,
}).format(number);
-const attachments = props.note?.media_attachments ?? [];
-const noteUrl = props.note && `/@${props.note.account.acct}/${props.note.id}`;
-const accountUrl = props.note && `/@${props.note.account.acct}`;
+const attachments = note.value?.media_attachments ?? [];
+const noteUrl = note.value && `/@${note.value.account.acct}/${note.value.id}`;