1
1
import { ExpandMore } from '@mui/icons-material' ;
2
2
import { MouseEvent , useState } from 'react' ;
3
- import { Avatar , AvatarGroup , Popover , Typography } from '../../base' ;
3
+ import { Avatar , AvatarGroup , Button , Popover , Typography } from '../../base' ;
4
4
import { iconSmall } from '../../constants/iconsSizes' ;
5
5
import { styled , useTheme } from '../../theme' ;
6
6
import { DARK_TEAL_BLUE } from '../../theme/colors/colors' ;
@@ -57,10 +57,12 @@ interface Users {
57
57
* @interface CollaboratorAvatarGroupProps
58
58
* @property {Users } users - Object containing user information mapped by client IDs
59
59
* @property {string } providerUrl - Base URL of the provider (e.g., 'https://github.com')
60
+ * @property {() => void } [onOpenWorkspace] - function to open workspace
60
61
*/
61
62
interface CollaboratorAvatarGroupProps {
62
63
users : Users ;
63
64
providerUrl : string ;
65
+ onOpenWorkspace ?: ( ) => void ;
64
66
}
65
67
66
68
interface StyledAvatarProps {
@@ -114,7 +116,8 @@ const StyledPopover = styled(Popover)(() => ({
114
116
115
117
const CollaboratorAvatarGroup = ( {
116
118
users,
117
- providerUrl
119
+ providerUrl,
120
+ onOpenWorkspace
118
121
} : CollaboratorAvatarGroupProps ) : JSX . Element => {
119
122
const [ anchorEl , setAnchorEl ] = useState < HTMLElement | null > ( null ) ;
120
123
@@ -139,7 +142,28 @@ const CollaboratorAvatarGroup = ({
139
142
. slice ( 0 , visibleAvatars )
140
143
. map ( ( [ clientID , user ] ) => {
141
144
return (
142
- < CustomTooltip key = { clientID } title = { user . name } arrow >
145
+ < CustomTooltip
146
+ key = { clientID }
147
+ title = {
148
+ < div style = { { justifyContent : 'center' } } >
149
+ < Typography style = { { fontSize : '0.9em' } } > { user . name } </ Typography >
150
+ < Button
151
+ size = "small"
152
+ variant = "outlined"
153
+ onClick = { onOpenWorkspace }
154
+ style = { {
155
+ fontSize : '0.9em' ,
156
+ padding : '2px 8px' ,
157
+ minWidth : 'auto' ,
158
+ marginTop : '4px'
159
+ } }
160
+ >
161
+ Open Recents
162
+ </ Button >
163
+ </ div >
164
+ }
165
+ arrow
166
+ >
143
167
< StyledAvatar
144
168
key = { clientID }
145
169
alt = { user . name }
0 commit comments