import React from 'react'; import styled, { css } from 'styled-components'; import { space } from 'styled-system'; import { T3nPlus } from '@t3n/icons'; import Box from '../Box'; import Grid from '../Grid'; import GridItem from '../GridItem'; import Heading from '../Heading'; import Image from '../Image'; import HoverLink from '../Link/HoverLink'; import Text from '../Text'; import TRBadge from '../TRBadge'; import Metabar from './Metabar'; export type ArticleProps = { identifier: string; type: string; date: string; title: string; teaser?: string; url: string; imageUrl?: string; readingTime: number; isPaywallArticle?: boolean; isTRArticle?: boolean; }; const UppercaseText = styled(Text)` text-transform: uppercase; font-size: 12px; `; const LargeTeaserImage = styled(Image)` border-radius: 4px; ${({ theme }) => space({ theme, mr: [0, 0, 0, 1] })}; `; const SmallTeaserImage = styled(Image)` border-radius: 4px; ${({ theme }) => space({ theme, mr: [0, 0, 0, 1] })}; ${({ theme }) => css` @media (min-width: ${theme.breakpoints[2]}) { aspect-ratio: 1 / 1; } `} `; const ArticleTeaser: React.FC<{ article: ArticleProps; teaserText?: boolean; largeTeaserImage?: boolean; smallTeaserImage?: boolean; isBookmarked: boolean; handleBookmarkClick: () => void; }> = ({ article, teaserText, largeTeaserImage, smallTeaserImage, isBookmarked, handleBookmarkClick, }) => { return ( <> {largeTeaserImage && article.imageUrl && ( )} {article.isPaywallArticle && ( )} {article.isTRArticle && } {article.type} {article.title} {teaserText && {article.teaser}} {smallTeaserImage && article.imageUrl && ( )} ); }; export default ArticleTeaser;