- {selectedMembers.map((member) => (
-
-
- {member.user.name
- ? member.user.name
- .split(" ")
- .map((namePart) => namePart.charAt(0).toUpperCase())
- .join("")
- : null}
-
-
+
+ {selectedMembers.map(({ value, imageUrl }) => (
+
))}
) : (
@@ -87,77 +81,7 @@ export default function MemberSelector({
>
)}
-
-
-
-
-
-
-
+
)}
>
);
diff --git a/apps/web/src/views/card/index.tsx b/apps/web/src/views/card/index.tsx
index 477e7a13..b7f281ce 100644
--- a/apps/web/src/views/card/index.tsx
+++ b/apps/web/src/views/card/index.tsx
@@ -4,6 +4,7 @@ import ContentEditable from "react-contenteditable";
import { useForm } from "react-hook-form";
import { IoChevronForwardSharp } from "react-icons/io5";
+import Avatar from "~/components/Avatar";
import LabelIcon from "~/components/LabelIcon";
import Modal from "~/components/modal";
import { NewWorkspaceForm } from "~/components/NewWorkspaceForm";
@@ -11,6 +12,8 @@ import { PageHead } from "~/components/PageHead";
import { useModal } from "~/providers/modal";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
+import { formatMemberDisplayName } from "~/utils/helpers";
+import { getPublicUrl } from "~/utils/supabase/getPublicUrl";
import ActivityList from "./components/ActivityList";
import { DeleteCardConfirmation } from "./components/DeleteCardConfirmation";
import { DeleteLabelConfirmation } from "./components/DeleteLabelConfirmation";
@@ -76,9 +79,25 @@ export default function CardPage() {
);
return {
- ...member,
- user: member.user ?? { id: "", name: null },
+ key: member.publicId,
+ value: formatMemberDisplayName(
+ member.user?.name ?? null,
+ member.user?.email ?? null,
+ ),
+ imageUrl: member.user?.image
+ ? getPublicUrl(member.user.image)
+ : undefined,
selected: isSelected ?? false,
+ leftIcon: (
+
+ ),
};
}) ?? [];