11import { ExpandMore } from '@mui/icons-material' ;
22import { MouseEvent , useState } from 'react' ;
3- import { Avatar , AvatarGroup , Popover , Typography } from '../../base' ;
3+ import { Avatar , AvatarGroup , Button , Popover , Typography } from '../../base' ;
44import { iconSmall } from '../../constants/iconsSizes' ;
55import { styled , useTheme } from '../../theme' ;
66import { DARK_TEAL_BLUE } from '../../theme/colors/colors' ;
@@ -57,10 +57,12 @@ interface Users {
5757 * @interface CollaboratorAvatarGroupProps
5858 * @property {Users } users - Object containing user information mapped by client IDs
5959 * @property {string } providerUrl - Base URL of the provider (e.g., 'https://github.com')
60+ * @property {() => void } [onOpenWorkspace] - function to open workspace
6061 */
6162interface CollaboratorAvatarGroupProps {
6263 users : Users ;
6364 providerUrl : string ;
65+ onOpenWorkspace ?: ( ) => void ;
6466}
6567
6668interface StyledAvatarProps {
@@ -114,7 +116,8 @@ const StyledPopover = styled(Popover)(() => ({
114116
115117const CollaboratorAvatarGroup = ( {
116118 users,
117- providerUrl
119+ providerUrl,
120+ onOpenWorkspace
118121} : CollaboratorAvatarGroupProps ) : JSX . Element => {
119122 const [ anchorEl , setAnchorEl ] = useState < HTMLElement | null > ( null ) ;
120123
@@ -139,7 +142,28 @@ const CollaboratorAvatarGroup = ({
139142 . slice ( 0 , visibleAvatars )
140143 . map ( ( [ clientID , user ] ) => {
141144 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+ >
143167 < StyledAvatar
144168 key = { clientID }
145169 alt = { user . name }
0 commit comments