Skip to content

Commit 75811b2

Browse files
committed
feat: add documentation for the code
Signed-off-by: amitamrutiya <[email protected]>
1 parent 2b11420 commit 75811b2

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/custom/CollaboratorAvatarGroup/CollaboratorAvatarGroup.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,58 @@ import { iconSmall } from '../../constants/iconsSizes';
66
import { styled, useTheme } from '../../theme';
77
import { CustomTooltip } from '../CustomTooltip';
88

9+
/**
10+
* CollaboratorAvatarGroup is a component that displays a group of user avatars with a popup for additional users.
11+
*
12+
* @component
13+
* @example
14+
* ```tsx
15+
* const users = {
16+
* 'client1': {
17+
* name: 'John Doe',
18+
* avatar_url: 'https://example.com/avatar1.jpg',
19+
* border_color: '#00B39F',
20+
* user_id: 'user123'
21+
* }
22+
* };
23+
*
24+
* <CollaboratorAvatarGroup
25+
* users={users}
26+
* providerUrl="https://redirect.com"
27+
* />
28+
* ```
29+
*/
30+
31+
/**
32+
* User object structure representing a collaborator
33+
* @interface User
34+
* @property {string} name - Display name of the user
35+
* @property {string} avatar_url - URL to the user's avatar image
36+
* @property {string} border_color - Color code for the avatar border (e.g., '#00B39F')
37+
* @property {string} user_id - Unique identifier for the user
38+
*/
939
interface User {
1040
name: string;
1141
avatar_url: string;
1242
border_color: string;
1343
user_id: string;
1444
}
1545

46+
/**
47+
* Collection of users mapped by their client IDs
48+
* @interface Users
49+
* @property {User} [clientID] - User object mapped to their client ID
50+
*/
1651
interface Users {
1752
[clientID: string]: User;
1853
}
1954

55+
/**
56+
* Props for the CollaboratorAvatarGroup component
57+
* @interface CollaboratorAvatarGroupProps
58+
* @property {Users} users - Object containing user information mapped by client IDs
59+
* @property {string} providerUrl - Base URL of the provider (e.g., 'https://github.com')
60+
*/
2061
interface CollaboratorAvatarGroupProps {
2162
users: Users;
2263
providerUrl: string;

0 commit comments

Comments
 (0)