evOo-local/apps/web/src/lib/messaging.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

21 lines
670 B
TypeScript

const PROVIDER_LABELS: Record<string, string> = {
sendblue: "iMessage",
slack: "Slack",
whatsapp: "WhatsApp",
telegram: "Telegram",
lark: "Feishu",
};
/** User-facing name of a messaging provider (falls back to the raw id). */
export function providerLabel(provider: string): string {
return PROVIDER_LABELS[provider] ?? provider;
}
/** Per-message provider label, narrowed to a recognized transport when available. */
export function messageProviderLabel(provider: string, transport?: string): string {
if (provider === "sendblue" && ["iMessage", "SMS", "RCS"].includes(transport ?? "")) {
return transport!;
}
return providerLabel(provider);
}