refactor: organise recipient utils

This commit is contained in:
David Nguyen
2023-09-12 12:33:04 +10:00
parent fbf32404a6
commit e8796a7d86
6 changed files with 23 additions and 22 deletions

View File

@ -1,7 +1,7 @@
import React from 'react';
import { recipientAvatarFallback } from '@documenso/lib/client-only/recipient-avatar-fallback';
import { getRecipientType } from '@documenso/lib/client-only/recipient-type';
import { recipientAbbreviation } from '@documenso/lib/utils/recipient-formatter';
import { Recipient } from '@documenso/prisma/client';
import { StackAvatar } from './stack-avatar';
@ -26,7 +26,7 @@ export function StackAvatars({ recipients }: { recipients: Recipient[] }) {
first={first}
zIndex={String(zIndex - index * 10)}
type={lastItemText && index === 4 ? 'unsigned' : getRecipientType(recipient)}
fallbackText={lastItemText ? lastItemText : recipientAvatarFallback(recipient)}
fallbackText={lastItemText ? lastItemText : recipientAbbreviation(recipient)}
/>
);
});