moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/**
* Tiny utility for turning a canonical persona ID (kebab-case)
* into a user-facing display name.
*
* Used by the connector landing surface ("Recommended for Sales Rep")
* and any other place that has only the ID at hand and needs a string
* for the UI without coupling to apps/web's onboarding constants or
* apps/agent's persona-data.
*
* Edge cases the regex covers:
* - 'sales-rep' → 'Sales Rep'
* - 'product-manager-senior' → 'Product Manager Senior'
* - 'general-purpose' → 'General Purpose'
* - 'pm' → 'Pm' (single word, capitalized)
* - '' → '' (empty stays empty)
* - undefined / null / non-string → '' (defensive)
*/
export function formatPersonaName(id: unknown): string {
if (typeof id !== 'string' || id.length === 0) return '';
return id
.split('-')
.map(part => part.length === 0 ? part : part[0].toUpperCase() + part.slice(1))
.join(' ');
}