// The Messages page a workspace opens; the practitioner's has no Inbox tab. export type StaffMessagesPageKind = 'desk' | 'colleagues' | 'practitioner'; // The badge is the Inbox tab's unread; without an Inbox it stays the awaiting-reply count. export const staffMessagesBadge = ({ page, deskInboxUnread, colleagueInboxUnread, awaitingReply, }: { page: StaffMessagesPageKind; deskInboxUnread: number | undefined; colleagueInboxUnread: number; awaitingReply: number; }): number => { if (page === 'desk') return deskInboxUnread ?? 0; if (page === 'colleagues') return colleagueInboxUnread; return awaitingReply; };