Something went wrong. Try again.
A fork of @slices.network/slices forked from slices.network/slices
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839import type { NetworkSlicesSliceDefsSliceView } from "../client.ts";
export interface SliceParams { handle: string; sliceId: string;}
export function extractSliceParams( params?: URLPatternResult,): SliceParams | null { const handle = params?.pathname.groups.handle; const sliceId = params?.pathname.groups.rkey;
if (!handle || !sliceId) { return null; }
return { handle, sliceId };}
export function buildSliceUrl( handle: string, sliceId: string, path?: string,): string { const basePath = `/profile/${handle}/slice/${sliceId}`; return path ? `${basePath}/${path}` : basePath;}
// Helper to build slice URLs from slice viewexport function buildSliceUrlFromView( slice: NetworkSlicesSliceDefsSliceView, sliceId: string, path?: string,): string { const handle = slice.creator?.handle || "unknown"; return buildSliceUrl(handle, sliceId, path);}