11import React from 'react' ;
22import { ConnectStatus , Organization , User } from 'src/core/api' ;
3- import { getIdentityMeta } from 'src/core/utils' ;
3+ import { getIdentityMeta , translate } from 'src/core/utils' ;
44import { ThreeDotsButton } from 'src/modules/connections/threeDotsButton' ;
55import { AvatarProfile } from 'src/modules/general/components/avatarProfile' ;
66import { Button } from 'src/modules/general/components/Button' ;
@@ -26,11 +26,11 @@ interface DesktopHeaderProps {
2626 displayConnectButton : ( ) => boolean ;
2727 displayMessageButton : ( ) => boolean ;
2828 displayThreeDotsButton : ( ) => boolean ;
29+ userTags : string [ ] ;
2930}
3031export const DesktopHeader : React . FC < DesktopHeaderProps > = ( {
3132 identity,
3233 myProfile,
33- isLoggedIn,
3434 connectStatus,
3535 handleOpenEditInfoModal,
3636 handleOpenQRCodeModal,
@@ -41,6 +41,7 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
4141 displayConnectButton,
4242 displayMessageButton,
4343 displayThreeDotsButton,
44+ userTags,
4445} ) => {
4546 const { username, name, profileImage } = getIdentityMeta ( identity ) ;
4647
@@ -59,7 +60,7 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
5960 < div className = "text-2xl md:text-3xl font-semibold text-Gray-light-mode-900" > { name } </ div >
6061 { type === 'users' && ( identity as User ) . open_to_work && (
6162 < Chip
62- label = "Available for work"
63+ label = { translate ( 'profile-header.available- for- work' ) }
6364 size = "lg"
6465 theme = "secondary"
6566 startIcon = { < Dot color = { variables . color_success_500 } size = "small" shadow = { false } /> }
@@ -69,13 +70,16 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
6970
7071 { type === 'organizations' && ( identity as Organization ) . hiring && (
7172 < Chip
72- label = "Hiring"
73+ label = { translate ( 'profile-header.hiring' ) }
7374 size = "lg"
7475 theme = "secondary"
7576 startIcon = { < Dot color = { variables . color_success_500 } size = "small" shadow = { false } /> }
7677 shape = "sharp"
7778 />
7879 ) }
80+
81+ { type === 'users' &&
82+ userTags . map ( tag => < Chip key = { tag } label = { tag } size = "lg" theme = "secondary" shape = "sharp" /> ) }
7983 </ div >
8084 < div className = "text-base font-normal text-Gray-light-mode-500" > { username } </ div >
8185 </ div >
@@ -88,7 +92,7 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
8892 onClick = { handleOpenQRCodeModal }
8993 >
9094 < Icon fontSize = { 20 } name = "share-01" color = { variables . color_grey_700 } />
91- Share
95+ { translate ( 'profile-header.actions.share' ) }
9296 </ Button >
9397 { displayMessageButton ( ) && (
9498 < Button
@@ -97,7 +101,7 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
97101 style = { { height : '40px' , fontSize : '14px' } }
98102 onClick = { handleMessage }
99103 >
100- Message
104+ { translate ( 'profile-header.actions.message' ) }
101105 </ Button >
102106 ) }
103107 { displayConnectButton ( ) && (
@@ -108,7 +112,9 @@ export const DesktopHeader: React.FC<DesktopHeaderProps> = ({
108112 style = { { height : '40px' , fontSize : '14px' } }
109113 onClick = { ( ) => setOpenConnectRequest ( true ) }
110114 >
111- { connectStatus === 'PENDING' ? 'Request sent' : 'Connect' }
115+ { connectStatus === 'PENDING'
116+ ? translate ( 'profile-header.actions.request-sent' )
117+ : translate ( 'profile-header.actions.connect' ) }
112118 </ Button >
113119 ) }
114120 { displayThreeDotsButton ( ) && < ThreeDotsButton otherIdentityId = { identity ?. id || '' } /> }
0 commit comments