import * as React from 'react'; import styled, { css } from 'styled-components'; import * as tokens from '@tokens'; import { dim } from '@dim'; import { Body, Label } from '@Typography'; import { ProfileProps } from './interface'; const Image = React.lazy(() => import('@Components/Image')); const sharedImageStyles = css` display: block; `; const Header = styled.div` display: flex; justify-content: center; padding: 0; > img { ${sharedImageStyles} } `; const Title = styled(Label)` margin: ${dim(2)} 0 ${dim(1)}; `; const ImageFallback = styled.div` ${sharedImageStyles} background: ${tokens.colorGrey40}; `; const Story: React.FC = ({ body, image = { alt: '', aspect: '3:2', src: '' }, title }) => ( {image && (
}> {image.alt}
)} {title && { title }} {body && { body }}
); export default Story;