2024-11-30 02:19:32 +01:00
|
|
|
<template>
|
2024-12-02 11:17:25 +01:00
|
|
|
<Card as="article" class="rounded-none border-0 duration-200 shadow- max-w-full">
|
2024-11-30 17:17:16 +01:00
|
|
|
<CardHeader class="pb-4" as="header">
|
2024-11-30 18:21:40 +01:00
|
|
|
<ReblogHeader v-if="note.reblog" :avatar="note.account.avatar" :display-name="note.account.display_name"
|
2024-12-02 22:21:04 +01:00
|
|
|
:url="reblogAccountUrl" :emojis="note.account.emojis" />
|
2024-12-04 12:47:17 +01:00
|
|
|
<Header :author="noteToUse.account" :author-url="accountUrl"
|
|
|
|
|
:corner-avatar="note.reblog ? note.account.avatar : undefined" :note-url="url"
|
|
|
|
|
:visibility="noteToUse.visibility" :created-at="new Date(noteToUse.created_at)"
|
|
|
|
|
:small-layout="smallLayout" />
|
2024-11-30 02:19:32 +01:00
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
2024-12-02 22:29:08 +01:00
|
|
|
<Content :content="noteToUse.content" :quote="note.quote ?? undefined"
|
|
|
|
|
:attachments="noteToUse.media_attachments" :plain-content="noteToUse.plain_content ?? undefined"
|
2024-12-07 15:16:45 +01:00
|
|
|
:emojis="noteToUse.emojis" :sensitive="noteToUse.sensitive" :content-warning="noteToUse.spoiler_text" />
|
2024-11-30 02:19:32 +01:00
|
|
|
</CardContent>
|
2024-12-02 11:17:25 +01:00
|
|
|
<CardFooter v-if="!hideActions" class="p-4 pt-0">
|
2024-11-30 18:21:40 +01:00
|
|
|
<Actions :reply-count="noteToUse.replies_count" :like-count="noteToUse.favourites_count" :url="url"
|
2024-12-02 22:29:08 +01:00
|
|
|
:api-note-string="JSON.stringify(note, null, 4)" :reblog-count="noteToUse.reblogs_count"
|
|
|
|
|
:remote-url="noteToUse.url" :is-remote="isRemote" :author-id="noteToUse.account.id"
|
|
|
|
|
@edit="useEvent('composer:edit', note)" @reply="useEvent('composer:reply', note)"
|
|
|
|
|
@quote="useEvent('composer:quote', note)" @delete="useEvent('note:delete', note)"
|
|
|
|
|
:note-id="noteToUse.id" :liked="noteToUse.favourited ?? false"
|
|
|
|
|
:reblogged="noteToUse.reblogged ?? false" />
|
2024-11-30 16:21:16 +01:00
|
|
|
</CardFooter>
|
2024-11-30 02:19:32 +01:00
|
|
|
</Card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import type { Status } from "@versia/client/types";
|
2024-11-30 16:21:16 +01:00
|
|
|
import { Card, CardFooter, CardHeader } from "../ui/card";
|
|
|
|
|
import Actions from "./actions.vue";
|
2024-11-30 02:19:32 +01:00
|
|
|
import Content from "./content.vue";
|
|
|
|
|
import Header from "./header.vue";
|
2024-11-30 16:21:16 +01:00
|
|
|
import ReblogHeader from "./reblog-header.vue";
|
2024-11-30 02:19:32 +01:00
|
|
|
|
|
|
|
|
const { note } = defineProps<{
|
|
|
|
|
note: Status;
|
2024-11-30 16:39:02 +01:00
|
|
|
hideActions?: boolean;
|
|
|
|
|
smallLayout?: boolean;
|
2024-11-30 02:19:32 +01:00
|
|
|
}>();
|
|
|
|
|
|
2024-11-30 16:39:02 +01:00
|
|
|
// Notes can be reblogs, in which case the actual thing to render is inside the reblog property
|
2024-12-01 18:54:17 +01:00
|
|
|
const noteToUse = computed(() => (note.reblog ? note.reblog : note));
|
2024-11-30 16:21:16 +01:00
|
|
|
|
2024-12-01 18:54:17 +01:00
|
|
|
const url = wrapUrl(`/@${noteToUse.value.account.acct}/${noteToUse.value.id}`);
|
|
|
|
|
const accountUrl = wrapUrl(`/@${noteToUse.value.account.acct}`);
|
2024-11-30 18:21:40 +01:00
|
|
|
const reblogAccountUrl = wrapUrl(`/@${note.account.acct}`);
|
2024-12-01 18:54:17 +01:00
|
|
|
const isRemote = noteToUse.value.account.acct.includes("@");
|
2024-11-30 16:21:16 +01:00
|
|
|
</script>
|