minor ui improvements for profile

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-05-13 16:08:40 +02:00
parent b91e0d0aa9
commit c4b02108ac
7 changed files with 96 additions and 72 deletions

View File

@@ -1,9 +1,15 @@
import type { IServiceProfile } from '@openpanel/db';
export function getProfileName(profile: IServiceProfile | undefined | null) {
export function getProfileName(
profile: IServiceProfile | undefined | null,
short = true
) {
if (!profile) return 'Unknown';
if (!profile.isExternal) {
if (short) {
return profile.id.slice(0, 4) + '...' + profile.id.slice(-4);
}
return profile.id;
}