import { RelationshipStatusEnum, RelationshipStatusInfoMessageParser } from '@nitrots/nitro-renderer'; import { FC } from 'react'; import { GetUserProfile, LocalizeText } from '../../api'; import { Flex, LayoutAvatarImageView } from '../../common'; interface RelationshipsContainerViewProps { relationships: RelationshipStatusInfoMessageParser; } interface RelationshipsContainerRelationshipViewProps { type: number; } export const RelationshipsContainerView: FC = props => { const { relationships = null } = props; const RelationshipComponent = ({ type }: RelationshipsContainerRelationshipViewProps) => { const relationshipInfo = (relationships && relationships.relationshipStatusMap.hasKey(type)) ? relationships.relationshipStatusMap.getValue(type) : null; const relationshipName = RelationshipStatusEnum.RELATIONSHIP_NAMES[type].toLocaleLowerCase(); return (

(relationshipInfo && (relationshipInfo.randomFriendId >= 1) && GetUserProfile(relationshipInfo.randomFriendId)) }> { (!relationshipInfo || (relationshipInfo.friendCount === 0)) && LocalizeText('extendedprofile.add.friends') } { (relationshipInfo && (relationshipInfo.friendCount >= 1)) && relationshipInfo.randomFriendName }

{ (relationshipInfo && (relationshipInfo.friendCount >= 1)) &&
}

{ (!relationshipInfo || (relationshipInfo.friendCount === 0)) && LocalizeText('extendedprofile.no.friends.in.this.category') } { (relationshipInfo && (relationshipInfo.friendCount > 1)) && LocalizeText(`extendedprofile.relstatus.others.${ relationshipName }`, [ 'count' ], [ (relationshipInfo.friendCount - 1).toString() ]) }  

); }; return ( <> ); };