stage 1 of oauth removal, switch to sanctum pat tokens
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export function useInitials() {
|
||||
return useCallback((fullName: string): string => {
|
||||
const names = fullName.trim().split(' ');
|
||||
return useCallback((fullName?: string | null): string => {
|
||||
if (!fullName) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const names = fullName
|
||||
.trim()
|
||||
.split(/\s+/u)
|
||||
.filter((segment) => segment.length > 0);
|
||||
|
||||
if (names.length === 0) return '';
|
||||
if (names.length === 1) return names[0].charAt(0).toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user