fyne-on/pages/@[user]/[post].vue

36 lines
1.2 KiB
Vue
Raw Normal View History

2022-11-14 00:05:32 +08:00
<script setup lang="ts">
const params = useRoute().params
2022-11-14 22:54:30 +08:00
const id = computed(() => params.post as string)
2022-11-14 11:33:09 +08:00
2022-11-14 22:54:30 +08:00
const { data: status } = await useAsyncData(`${id}-status`, () => masto.statuses.fetch(params.post as string))
const { data: context } = await useAsyncData(`${id}-context`, () => masto.statuses.fetchContext(params.post as string))
2022-11-14 00:05:32 +08:00
</script>
<template>
2022-11-21 21:21:53 +08:00
<template v-if="status">
<template v-for="comment of context?.ancestors" :key="comment.id">
<StatusCard :status="comment" border="t border" pt-4 />
</template>
<StatusDetails :status="status" border="t border" pt-4 />
<div border="t border" p6 flex gap-4>
<img :src="currentUser?.account?.avatar" rounded w-10 h-10 bg-gray:10>
2022-11-21 21:21:53 +08:00
<PublishWidget
w-full
:draft-key="`reply-${id}`"
:placeholder="`Reply to ${status?.account ? getDisplayName(status?.account) : 'this thread'}`"
2022-11-21 21:21:53 +08:00
:in-reply-to-id="id"
/>
</div>
<template v-for="comment of context?.descendants" :key="comment.id">
<StatusCard :status="comment" border="t border" pt-4 />
</template>
2022-11-18 10:37:22 +01:00
</template>
2022-11-21 14:55:31 +08:00
2022-11-21 21:21:53 +08:00
<template>
<div>
Status not found
</div>
2022-11-14 22:54:30 +08:00
</template>
2022-11-14 00:05:32 +08:00
</template>