feat(status): try to open in original site
This commit is contained in:
parent
259e11c097
commit
569655095d
30
components/status/StatusNotFound.vue
Normal file
30
components/status/StatusNotFound.vue
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const { account, status } = defineProps<{
|
||||||
|
account: string
|
||||||
|
status: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const originalUrl = computed(() => {
|
||||||
|
const [handle, _server] = account.split('@')
|
||||||
|
const server = _server || currentUser.value?.server
|
||||||
|
if (!server)
|
||||||
|
return null
|
||||||
|
|
||||||
|
return `https://${server}/@${handle}/${status}`
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CommonNotFound>
|
||||||
|
<div flex="~ col center gap2">
|
||||||
|
<div>Status not found</div>
|
||||||
|
|
||||||
|
<NuxtLink v-if="originalUrl" :to="originalUrl" target="_blank">
|
||||||
|
<button btn-solid flex="~ center gap-2" px2 py1>
|
||||||
|
<div i-ri:arrow-right-up-line />
|
||||||
|
Try original site
|
||||||
|
</button>
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
</CommonNotFound>
|
||||||
|
</template>
|
|
@ -74,9 +74,7 @@ onReactivated(() => {
|
||||||
<div border="t base" :style="{ height: `${bottomSpace}px` }" />
|
<div border="t base" :style="{ height: `${bottomSpace}px` }" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CommonNotFound v-else>
|
<StatusNotFound v-else :account="$route.params.account" :status="id" />
|
||||||
Status not found
|
|
||||||
</CommonNotFound>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<StatusCardSkeleton v-else border="b base" py-3 />
|
<StatusCardSkeleton v-else border="b base" py-3 />
|
||||||
|
|
Loading…
Reference in a new issue