formatted, added team index, create, show
CI/CD / test_and_check_app (push) Failing after 48s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-09-19 01:09:55 +02:00
parent 9a025d6a80
commit b79d93fede
76 changed files with 3290 additions and 3146 deletions
+14 -14
View File
@@ -1,29 +1,29 @@
export type UseInitialsReturn = {
getInitials: (fullName?: string) => string;
getInitials: (fullName?: string) => string;
};
function getInitial(name: string): string {
return Array.from(name)[0] ?? '';
return Array.from(name)[0] ?? '';
}
export function getInitials(fullName?: string): string {
if (!fullName) {
return '';
}
if (!fullName) {
return '';
}
const names = fullName.trim().split(/\s+/u).filter(Boolean);
const names = fullName.trim().split(/\s+/u).filter(Boolean);
if (names.length === 0) {
return '';
}
if (names.length === 0) {
return '';
}
if (names.length === 1) {
return getInitial(names[0]).toUpperCase();
}
if (names.length === 1) {
return getInitial(names[0]).toUpperCase();
}
return `${getInitial(names[0])}${getInitial(names[names.length - 1])}`.toUpperCase();
return `${getInitial(names[0])}${getInitial(names[names.length - 1])}`.toUpperCase();
}
export function useInitials(): UseInitialsReturn {
return { getInitials };
return { getInitials };
}