UNPKG

@automattic/social-previews

Version:

A suite of components to generate previews for a post for both social and search engines.

14 lines 1.36 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Card } from './card'; import { Footer } from './footer'; import { Header } from './header'; import { Media } from './media'; import { QuoteTweet } from './quote-tweet'; import { Sidebar } from './sidebar'; import { Text } from './text'; import './style.scss'; export const TwitterPostPreview = ({ date, description, image, media, name, profileImage, screenName, showThreadConnector, text, title, tweet, cardType, url, }) => { const hasMedia = !!media?.length; return (_jsx("div", { className: "twitter-preview__wrapper", children: _jsxs("div", { className: "twitter-preview__container", children: [_jsx(Sidebar, { profileImage: profileImage, showThreadConnector: showThreadConnector }), _jsxs("div", { className: "twitter-preview__main", children: [_jsx(Header, { name: name, screenName: screenName, date: date }), _jsxs("div", { className: "twitter-preview__content", children: [text ? _jsx(Text, { text: text, url: url || '', retainUrl: hasMedia }) : null, hasMedia ? _jsx(Media, { media: media }) : null, tweet ? _jsx(QuoteTweet, { tweet: tweet }) : null, !hasMedia && url && (_jsx(Card, { description: description || '', image: image, title: title || '', cardType: cardType || '', url: url }))] }), _jsx(Footer, {})] })] }) })); }; //# sourceMappingURL=post-preview.js.map