Skip to content

Commit

Permalink
test auto-refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
chentong7 committed Oct 29, 2024
1 parent badf7ec commit 9354a87
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions examples/apps/ai-collab/src/components/UserPresenceGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,28 @@ const UserPresenceGroup: React.FC<UserPresenceProps> = ({
{photoUrls.length === 0 ? (
<Avatar alt="User Photo" sx={{ width: 56, height: 56 }} />
) : (
photoUrls.map((photo, index) => (
<StyledBadge
key={index}
max={4}
overlap="circular"
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
variant="dot"
>
<Avatar alt="User Photo" src={photo} sx={{ width: 56, height: 56 }} />
</StyledBadge>
))
<>
{photoUrls.slice(0, 4).map((photo, index) => (
<StyledBadge
key={index}
overlap="circular"
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
variant="dot"
>
<Avatar alt="User Photo" src={photo} sx={{ width: 56, height: 56 }} />
</StyledBadge>
))}
{photoUrls.length > 4 && (
<Badge
overlap="circular"
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
badgeContent={`+${photoUrls.length - 4}`}
color="primary"
>
<Avatar alt="More Users" sx={{ width: 56, height: 56 }} />
</Badge>
)}
</>
)}
</div>
);
Expand Down

0 comments on commit 9354a87

Please sign in to comment.