import * as React from 'react'; import styled, { css } from 'styled-components'; import * as tokens from '@tokens'; import { dim } from '@dim'; import { Anchor, Label } from '@Typography'; import { ProfileProps } from './interface'; const Image = React.lazy(() => import('@Components/Image')); const sharedImageStyles = css` border-radius: 50%; display: block; height: auto; width: calc(100% * 6 / 12); `; const Header = styled.div` display: flex; justify-content: center; padding: ${dim(1)} 0; > img { ${sharedImageStyles} } `; const ImageFallback = styled.div` ${sharedImageStyles} background: ${tokens.colorGrey40}; `; const Title = styled(Label)` color: ${tokens.colorGrey40}; `; const Profile: React.FC = ({ image = { alt: '', aspect: '1:1', src: '' }, link = { url: '', text: '' }, title }) => ( {image && (
}> {image.alt}
)} {title && Title} {link && {link.text}}
); export default Profile;