forked from Mirrors/elk
feat(status): try to open in original site
This commit is contained in:
parent
259e11c097
commit
569655095d
2 changed files with 31 additions and 3 deletions
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>
|
||||
|
||||
<CommonNotFound v-else>
|
||||
Status not found
|
||||
</CommonNotFound>
|
||||
<StatusNotFound v-else :account="$route.params.account" :status="id" />
|
||||
</template>
|
||||
|
||||
<StatusCardSkeleton v-else border="b base" py-3 />
|
||||
|
|
Loading…
Reference in a new issue