2021-02-03 11:49:51 -08:00
|
|
|
import React from 'react';
|
2021-01-17 12:54:49 -08:00
|
|
|
import { Avatar } from 'antd';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import defaultAvatar from '../../images/default_avatar.png';
|
2021-02-03 11:49:51 -08:00
|
|
|
import { EntityType } from '../../types.generated';
|
|
|
|
import { useEntityRegistry } from '../useEntityRegistry';
|
2021-01-17 12:54:49 -08:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
urn: string;
|
|
|
|
pictureLink?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const defaultProps = {
|
|
|
|
pictureLink: undefined,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const ManageAccount = ({ urn: _urn, pictureLink: _pictureLink }: Props) => {
|
2021-02-03 11:49:51 -08:00
|
|
|
const entityRegistry = useEntityRegistry();
|
2021-01-17 12:54:49 -08:00
|
|
|
return (
|
2021-02-09 14:30:23 -08:00
|
|
|
<Link to={`${entityRegistry.getPathName(EntityType.CorpUser)}/${_urn}`}>
|
2021-01-17 12:54:49 -08:00
|
|
|
<Avatar
|
|
|
|
style={{
|
|
|
|
marginRight: '15px',
|
|
|
|
color: '#f56a00',
|
|
|
|
backgroundColor: '#fde3cf',
|
|
|
|
}}
|
|
|
|
src={_pictureLink || defaultAvatar}
|
|
|
|
/>
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ManageAccount.defaultProps = defaultProps;
|