11import React , { memo } from 'react' ;
22import Avatar from '@mui/material/Avatar' ;
3+ import { Typography } from '@mui/material' ;
34import Badge from '@mui/material/Badge' ;
45import Grid from '@mui/material/Grid' ;
56
@@ -9,9 +10,13 @@ import { getAvatarUrl } from 'utils/avatars';
910
1011import { Box , TimeAgo , UserName , UserStatus , Btn } from './styles' ;
1112
12- type Props = { user : UserData ; selectUser : ( user ?: UserData ) => void } ;
13+ type Props = {
14+ user : UserData ;
15+ selectUser : ( user ?: UserData ) => void ;
16+ currentUser : boolean ;
17+ } ;
1318
14- function UserInGroup ( { user, selectUser } : Props ) {
19+ function UserInGroup ( { user, selectUser, currentUser } : Props ) {
1520 const { name, status, online, connectedDate, avatar } = user ;
1621 const parsedDate = connectedDate ? new Date ( connectedDate ) : new Date ( ) ;
1722
@@ -30,7 +35,14 @@ function UserInGroup({ user, selectUser }: Props) {
3035 </ Badge >
3136 </ Grid >
3237 < Grid item xs = { 0 } sm = { 8 } >
33- < UserName > { name } </ UserName >
38+ < UserName >
39+ { name }
40+ { currentUser ? (
41+ < Typography component = "span" color = "gray" marginLeft = { 1 } >
42+ (you)
43+ </ Typography >
44+ ) : null }
45+ </ UserName >
3446 < UserStatus color = "secondary" > { status } </ UserStatus >
3547 </ Grid >
3648 < Grid item xs = { 0 } sm = { 2 } >
0 commit comments