import * as React from 'react'; import styled, { css } from 'styled-components'; import * as tokens from '@tokens'; import { dim } from '@dim'; import { Anchor, Body, 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 Title = styled(Label)` margin: ${dim(2)} 0 ${dim(1)}; `; const ImageFallback = styled.div` ${sharedImageStyles} background: ${tokens.colorGrey40}; `; const Profile: React.FC = ({ bio, body, image = { alt: '', aspect: '1:1', src: '' }, link = { url: '', text: '' }, title }) => ( {image && (
}> {image.alt}
)} {title && { title }} {bio && { bio }} {link && {link.text}} {body && {body}}
); export default Profile;