chore: refactor stacked avatars into component

This commit is contained in:
Ephraim Atta-Duncan
2023-06-25 14:23:18 +00:00
parent 2e8e39c5a9
commit dbcf7771b9
4 changed files with 72 additions and 60 deletions

View File

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

View File

@ -0,0 +1,8 @@
import { Recipient } from '@documenso/prisma/client';
export const type = (recipient: Recipient) =>
recipient.sendStatus === 'SENT' && recipient.signingStatus === 'SIGNED'
? 'completed'
: recipient.sendStatus === 'SENT' && recipient.signingStatus === 'NOT_SIGNED'
? 'waiting'
: 'unsigned';