Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

621 B
Raw Blame
import type { MobileSavedAccount } from '@/auth/mobileAccountVault';

export interface AccountSwitcherPresentation {
  imageUrl: string | null;
  isOrg: boolean;
  subtitle: string | null;
  title: string;
}

export function presentSavedAccount(
  account: MobileSavedAccount,
): AccountSwitcherPresentation {
  const isOrg = account.kind === 'org';
  return {
    isOrg,
    imageUrl: isOrg ? account.orgLogoUrl : account.avatarUrl,
    title: isOrg
      ? account.orgName || account.displayName
      : account.displayName || account.email || 'Cindy',
    subtitle: isOrg ? account.displayName : account.email,
  };
}