Thread viewer for Bluesky
1<script lang="ts">
2 import { accountAPI, api } from '../../api.js';
3 import { linkToPostById } from '../../router.js';
4 import { atURI } from '../../utils.js';
5
6 let { uri }: { uri: string } = $props();
7 let { repo, rkey } = $derived(atURI(uri));
8</script>
9
10<p class="back">
11 <i class="fa-solid fa-reply"></i>
12
13 {#if accountAPI && repo == accountAPI.user.did}
14 <a href="{linkToPostById(repo, rkey)}">Reply to you</a>
15 {:else}
16 {#await api.fetchHandleForDid(repo)}
17 <a href="{linkToPostById(repo, rkey)}">Reply</a>
18 {:then handle}
19 <a href="{linkToPostById(handle, rkey)}">Reply to @{handle}</a>
20 {:catch}
21 <a href="{linkToPostById(repo, rkey)}">Reply to {repo}</a>
22 {/await}
23 {/if}
24</p>