diff --git a/apps/web/components/booking/UserAvatars.tsx b/apps/web/components/booking/UserAvatars.tsx index a20351343d..3e336910be 100644 --- a/apps/web/components/booking/UserAvatars.tsx +++ b/apps/web/components/booking/UserAvatars.tsx @@ -7,7 +7,7 @@ export const UserAvatars = ({ users, ...props }: { - profile: { image: string | null; name?: string | null }; + profile: { image: string | null; name?: string | null; username?: string | null }; showMembers: boolean; users: { username: string | null; name?: string | null }[]; } & Pick) => { @@ -17,15 +17,26 @@ export const UserAvatars = ({ border="border-2 dark:border-darkgray-100 border-white" items={ [ - { image: profile.image, alt: profile.name, title: profile.name }, + { + image: profile.image, + alt: profile.name, + title: profile.name, + href: profile.username ? `${CAL_URL}/${profile.username}` : undefined, + }, ...(showMembers ? users.map((user) => ({ title: user.name, image: `${CAL_URL}/${user.username}/avatar.png`, alt: user.name || undefined, + href: user.username ? `${CAL_URL}/${user.username}` : undefined, })) : []), - ].filter((item) => !!item.image) as { image: string; alt?: string; title?: string }[] + ].filter((item) => !!item.image) as { + image: string; + alt?: string; + title?: string; + href?: string; + }[] } size={props.size} truncateAfter={props.truncateAfter} diff --git a/apps/web/components/ui/AvatarGroup.tsx b/apps/web/components/ui/AvatarGroup.tsx index 73bd09c204..06c8a1def5 100644 --- a/apps/web/components/ui/AvatarGroup.tsx +++ b/apps/web/components/ui/AvatarGroup.tsx @@ -1,3 +1,4 @@ +import Link from "next/link"; import React from "react"; import classNames from "@lib/classNames"; @@ -12,6 +13,7 @@ export type AvatarGroupProps = { image: string; title?: string; alt?: string; + href?: string; }[]; className?: string; }; @@ -21,15 +23,25 @@ export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) {