diff --git a/src/components/ui/AvatarGroup.tsx b/src/components/ui/AvatarGroup.tsx new file mode 100644 index 0000000..3ba48ee --- /dev/null +++ b/src/components/ui/AvatarGroup.tsx @@ -0,0 +1,39 @@ +import { cls } from "@/lib/utils"; +import ImageOrVideo from "./ImageOrVideo"; + +interface Avatar { + src: string; + alt: string; +} + +interface AvatarGroupProps { + avatars: Avatar[]; + totalCount: number; + className?: string; +} + +const AvatarGroup = ({ avatars, totalCount, className = "" }: AvatarGroupProps) => { + const remainingCount = totalCount - avatars.length; + + return ( +
+
+ {avatars.map((avatar, index) => ( +
+ +
+ ))} + {remainingCount > 0 && ( +
+ +{remainingCount > 999 ? `${Math.floor(remainingCount / 1000)}k` : remainingCount} +
+ )} +
+ + Join {totalCount.toLocaleString()}+ happy users + +
+ ); +}; + +export default AvatarGroup; \ No newline at end of file