refactor: organise recipient utils

This commit is contained in:
David Nguyen
2023-09-12 12:33:04 +10:00
committed by Mythie
parent 48e58d4675
commit a72248e871
6 changed files with 23 additions and 22 deletions

View File

@ -1,7 +0,0 @@
import { Recipient } from '@documenso/prisma/client';
import { initials } from './recipient-initials';
export const recipientAvatarFallback = (recipient: Recipient) => {
return initials(recipient.name) || recipient.email.slice(0, 1).toUpperCase();
};

View File

@ -1,6 +0,0 @@
export const initials = (text: string) =>
text
?.split(' ')
.map((name: string) => name.slice(0, 1).toUpperCase())
.slice(0, 2)
.join('');