Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import {type AppBskyGraphDefs, AtUri} from '@atproto/api'
export function makeProfileLink( info: { did: string handle: string }, ...segments: string[]) { return [`/profile`, info.did, ...segments].join('/')}
export function makeCustomFeedLink( did: string, rkey: string, segment?: string, feedCacheKey?: 'discover' | 'explore',) { return ( [`/profile`, did, 'feed', rkey, ...(segment ? [segment] : [])].join('/') + (feedCacheKey ? `?feedCacheKey=${encodeURIComponent(feedCacheKey)}` : '') )}
export function makeListLink(did: string, rkey: string, ...segments: string[]) { return [`/profile`, did, 'lists', rkey, ...segments].join('/')}
export function makeTagLink(did: string) { return `/search?q=${encodeURIComponent(did)}`}
export function makeSearchLink(props: {query: string; from?: 'me' | string}) { return `/search?q=${encodeURIComponent( props.query + (props.from ? ` from:${props.from}` : ''), )}`}
export function makeStarterPackLink( starterPackOrName: | AppBskyGraphDefs.StarterPackViewBasic | AppBskyGraphDefs.StarterPackView | string, rkey?: string,) { if (typeof starterPackOrName === 'string') { return `https://blacksky.community/start/${starterPackOrName}/${rkey}` } else { const uriRkey = new AtUri(starterPackOrName.uri).rkey return `https://blacksky.community/start/${starterPackOrName.creator.handle}/${uriRkey}` }}