@@ -174,7 +121,12 @@ export default async function DashboardPage() {
key={recipient.id}
className="my-1 flex items-center gap-2"
>
- {renderAvatar(recipient)}
+
{recipient.email}
@@ -191,7 +143,12 @@ export default async function DashboardPage() {
key={recipient.id}
className="my-1 flex items-center gap-2"
>
- {renderAvatar(recipient)}
+
{recipient.email}
@@ -208,7 +165,12 @@ export default async function DashboardPage() {
key={recipient.id}
className="my-1 flex items-center gap-2"
>
- {renderAvatar(recipient)}
+
{recipient.email}
diff --git a/apps/web/src/components/(dashboard)/avatar/stack-avatars.tsx b/apps/web/src/components/(dashboard)/avatar/stack-avatars.tsx
new file mode 100644
index 000000000..69c2fae7e
--- /dev/null
+++ b/apps/web/src/components/(dashboard)/avatar/stack-avatars.tsx
@@ -0,0 +1,36 @@
+import React from 'react';
+
+import { initials } from '@documenso/lib/client-only/recipient-initials';
+import { type } from '@documenso/lib/client-only/recipient-type';
+import { Recipient } from '@documenso/prisma/client';
+
+import { StackAvatar } from '.';
+
+export function StackAvatars({ recipients }: { recipients: Recipient[] }) {
+ const renderStackAvatars = (recipients: Recipient[]) => {
+ const zIndex = 50;
+ const itemsToRender = recipients.slice(0, 5);
+ const remainingItems = recipients.length - itemsToRender.length;
+
+ return itemsToRender.map((recipient: Recipient, index: number) => {
+ const first = index === 0 ? true : false;
+
+ const lastItemText =
+ index === itemsToRender.length - 1 && remainingItems > 0
+ ? `+${remainingItems + 1}`
+ : undefined;
+
+ return (
+
+ );
+ });
+ };
+
+ return <>{renderStackAvatars(recipients)}>;
+}
diff --git a/packages/lib/client-only/recipient-initials.ts b/packages/lib/client-only/recipient-initials.ts
new file mode 100644
index 000000000..0712ccd7d
--- /dev/null
+++ b/packages/lib/client-only/recipient-initials.ts
@@ -0,0 +1,6 @@
+export const initials = (text: string) =>
+ text
+ ?.split(' ')
+ .map((name: string) => name.slice(0, 1).toUpperCase())
+ .slice(0, 2)
+ .join('') ?? 'UK';
diff --git a/packages/lib/client-only/recipient-type.ts b/packages/lib/client-only/recipient-type.ts
new file mode 100644
index 000000000..dbcf5baaf
--- /dev/null
+++ b/packages/lib/client-only/recipient-type.ts
@@ -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';