type DisplayUser = { name?: string | null; provider?: string | null }; export const FALLBACK_NAME = "Builder"; export function displayName(user: DisplayUser): string { const name = user.name?.trim(); return name && !name.includes("@") ? name : FALLBACK_NAME; } export function firstName(user: DisplayUser): string { return displayName(user).split(/\s+/)[0]; } export function providerLabel(user: DisplayUser): string | null { if (user.provider === "apple") return "Apple"; if (user.provider === "google") return "Google"; return null; }