// The patient's one unread number: direct threads plus every listed team except the one on screen. export const countPatientInboxUnread = ( directUnread: number, teamIds: readonly string[], teamSummaries: ReadonlyMap, openTeamId?: string | null, ): number => teamIds.reduce( (sum, teamId) => (teamId === openTeamId ? sum : sum + (teamSummaries.get(teamId)?.unread ?? 0)), directUnread, );