2022-11-13 16:05:32 +00:00
|
|
|
<script setup lang="ts">
|
2022-11-24 04:02:18 +00:00
|
|
|
import type { Component } from 'vue'
|
2022-11-22 23:42:20 +00:00
|
|
|
|
2022-11-13 16:05:32 +00:00
|
|
|
const params = useRoute().params
|
2022-11-24 05:47:14 +00:00
|
|
|
const id = $computed(() => params.status as string)
|
2022-11-24 04:02:18 +00:00
|
|
|
const main = ref<Component | null>(null)
|
2022-11-14 03:33:09 +00:00
|
|
|
|
2022-11-24 05:47:14 +00:00
|
|
|
const status = await fetchStatus(id)
|
|
|
|
const { data: context } = useAsyncData(`context:${id}`, () => masto.statuses.fetchContext(id))
|
2022-11-13 16:05:32 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-21 13:21:53 +00:00
|
|
|
<template v-if="status">
|
2022-11-24 04:02:18 +00:00
|
|
|
<template v-if="context">
|
|
|
|
<template v-for="comment of context?.ancestors" :key="comment.id">
|
2022-11-24 05:47:14 +00:00
|
|
|
<StatusCard :status="comment" border="t base" py3 />
|
2022-11-24 04:02:18 +00:00
|
|
|
</template>
|
2022-11-21 13:21:53 +00:00
|
|
|
</template>
|
2022-11-24 04:02:18 +00:00
|
|
|
|
2022-11-24 05:47:14 +00:00
|
|
|
<StatusDetails ref="main" :status="status" border="t base" />
|
2022-11-23 02:16:31 +00:00
|
|
|
<div v-if="currentUser" border="t base" p6 flex gap-4>
|
2022-11-22 23:42:20 +00:00
|
|
|
<AccountAvatar :account="currentUser.account" w-10 h-10 />
|
2022-11-21 13:21:53 +00:00
|
|
|
<PublishWidget
|
|
|
|
w-full
|
|
|
|
:draft-key="`reply-${id}`"
|
2022-11-21 15:07:55 +00:00
|
|
|
:placeholder="`Reply to ${status?.account ? getDisplayName(status?.account) : 'this thread'}`"
|
2022-11-21 13:21:53 +00:00
|
|
|
:in-reply-to-id="id"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2022-11-24 04:02:18 +00:00
|
|
|
<template v-if="context">
|
|
|
|
<template v-for="comment of context?.descendants" :key="comment.id">
|
2022-11-24 05:47:14 +00:00
|
|
|
<StatusCard :status="comment" border="t base" py3 />
|
2022-11-24 04:02:18 +00:00
|
|
|
</template>
|
2022-11-21 13:21:53 +00:00
|
|
|
</template>
|
2022-11-18 09:37:22 +00:00
|
|
|
</template>
|
2022-11-21 06:55:31 +00:00
|
|
|
|
2022-11-23 17:16:10 +00:00
|
|
|
<CommonNotFound v-else>
|
|
|
|
Status not found
|
|
|
|
</CommonNotFound>
|
2022-11-13 16:05:32 +00:00
|
|
|
</template>
|