This repository has no description
1import { AppBskyFeedDefs, AppBskyGraphDefs, AtUri } from '@atproto/api';
2
3export const getStarterPackImage = (
4 starterPack: AppBskyGraphDefs.StarterPackViewBasic,
5) => {
6 const rkey = new AtUri(starterPack.uri).rkey;
7 return `https://ogcard.cdn.bsky.app/start/${starterPack.creator.did}/${rkey}`;
8};
9
10export const getStarterPackLink = (
11 starterPack: AppBskyGraphDefs.StarterPackViewBasic,
12) => {
13 const rkey = new AtUri(starterPack.uri).rkey;
14 const handleOrDid = starterPack.creator.handle || starterPack.creator.did;
15
16 return `https://bsky.app/starter-pack/${handleOrDid}/${rkey}`;
17};
18
19export const getFeedLink = (feed: AppBskyFeedDefs.GeneratorView) => {
20 const rkey = new AtUri(feed.uri).rkey;
21 const handleOrDid = feed.creator.handle || feed.creator.did;
22
23 return `https://bsky.app/profile/${handleOrDid}/feed/${rkey}`;
24};
25
26export const getListLink = (list: AppBskyGraphDefs.ListView) => {
27 const rkey = new AtUri(list.uri).rkey;
28 const handleOrDid = list.creator.handle || list.creator.did;
29
30 return `https://bsky.app/profile/${handleOrDid}/lists/${rkey}`;
31};