import classNames from "@calcom/lib/classNames"; import { Avatar } from "./Avatar"; export type AvatarGroupProps = { size: "sm" | "lg"; items: { image: string; title?: string; alt?: string; href?: string; }[]; className?: string; accepted?: boolean; truncateAfter?: number; }; export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) { const LENGTH = props.items.length; const truncateAfter = props.truncateAfter || 4; /** * First, filter all the avatars object that have image * Then, slice it until before `truncateAfter` index */ const displayedAvatars = props.items.filter((avatar) => avatar.image).slice(0, truncateAfter); const numTruncatedAvatars = LENGTH - displayedAvatars.length; return (