import * as React from "react"; import styled, { css, StyledFunction } from "styled-components"; import * as tokens from "@tokens"; import { dim } from "@dim"; import { mq } from "@tokensDir/media-query"; import { CardProps, StyledCardProps } from "./interface"; import Profile from "./profile"; import Feature from "./feature"; const Section: StyledFunction = styled.section; const StyledCard = Section` align-items: center; border-bottom: 1px solid ${tokens.colorGrey15}; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: ${dim(2)} 0 ${dim(4)}; position: relative; ${({ type }: CardProps) => type === "feature" && css` align-items: flex-start; justify-content: flex-start; text-align: left; `} ${mq.md` border-bottom: none; grid-column: ${({ column }: StyledCardProps) => column}; padding: ${dim(3)} ${dim(2)}; ${({ type }: CardProps) => type === "feature" && css` padding: 0 0 ${dim(6)}; `} &:after { background: ${tokens.colorGrey15}; content: ""; height: 100%; position: absolute; right: -${dim(2)}; width: 1px; } &:last-child:after { background: ${tokens.colorWhite}; content: ""; height: 100%; position: absolute; right: -${dim(2)}; width: 1px; } `} `; const Card: React.FC = ({ bio = "", body = "", column = "", image = { alt: "", aspect: "1:1", src: "" }, link = { url: "", text: "" }, title = "", type = "" }) => ( {type === "profile" && ( )} {type === "feature" && ( )} ); export default Card;