import * as React from 'react'; import styled from 'styled-components'; import * as tokens from '@tokens'; import { dim } from '@dim'; import { mq } from '@tokensDir/media-query'; import { RCCSurveyCTAProps } from "./interface"; import StyledButton from '@Components/Button'; import H3 from '@Components/Typography/H3'; import Body from '@Components/Typography/Body'; const Image = React.lazy(() => import('@Components/Image')); const Inner = styled.div` background: ${tokens.colorRCCPink}; padding: ${dim(3)}; color: ${tokens.colorWhite}; text-align: center; ${mq.md` display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: 1fr; grid-gap: ${dim(2)} 0; padding: ${dim(4)} 0; text-align: initial; `} `; const Title = styled(H3)` padding: ${dim(5)} 0; margin: 0; border-top: 1px solid ${tokens.colorGrey15}; `; const Subtitle = styled(H3)` padding: ${dim(1)} 0; margin: 0; `; const LogoWrap = styled.div` max-width: ${dim(15)}; margin: 0 auto ${dim(2)}; ${mq.md` grid-area: 1 / 2 / 2 / 4; align-self: center; margin: 0; `} `; const TextWrap = styled.div` ${mq.md` grid-area: 1 / 4 / 2 / 10; align-self: center; padding: 0 ${dim(2)}; `} `; const CTA = styled(StyledButton)` margin-top: ${dim(2)}; ${mq.md` grid-area: 1 / 10 / 2 / 12; align-self: center; margin-top: 0; `} `; const ImageFallback = styled.div` background: ${tokens.colorGrey40}; `; const RCCSurveyCTA: React.FC = ({ title, subTitle, body, buttonText, image = { alt: '', aspect: '1:1', src: '' } }: RCCSurveyCTAProps) => (
{ title && {title}} {image && ( }> {image.alt} )} { subTitle && {subTitle}} { body && {body}} { buttonText && {buttonText}}
); export default RCCSurveyCTA;