Sifa professional network frontend (Next.js, React, TailwindCSS) sifa.id/
at main 21 lines 725 B view raw
1export type FollowerSource = 'atproto' | 'sifa'; 2 3export interface DisplayFollowers { 4 count: number; 5 source: FollowerSource; 6} 7 8/** 9 * Prefer AT Protocol (Bluesky) follower count over Sifa-internal count. 10 * Returns the count and source to display, or undefined if both are zero/absent. 11 */ 12export function resolveDisplayFollowers( 13 atprotoFollowersCount: number | undefined | null, 14 followersCount: number | undefined | null, 15): DisplayFollowers | undefined { 16 if (atprotoFollowersCount != null && atprotoFollowersCount > 0) 17 return { count: atprotoFollowersCount, source: 'atproto' }; 18 if (followersCount != null && followersCount > 0) 19 return { count: followersCount, source: 'sifa' }; 20 return undefined; 21}