@automattic/social-previews
Version:
A suite of components to generate previews for a post for both social and search engines.
14 lines • 1.63 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { __ } from '@wordpress/i18n';
import { SectionHeading } from '../shared/section-heading';
import { TumblrLinkPreview } from './link-preview';
import { TumblrPostPreview } from './post-preview';
export const TumblrPreviews = ({ headingLevel, hideLinkPreview, hidePostPreview, ...props }) => {
const hasMedia = !!props.media?.length;
return (_jsxs("div", { className: "social-preview tumblr-preview", children: [!hidePostPreview && (_jsxs("section", { className: "social-preview__section tumblr-preview__section", children: [_jsx(SectionHeading, { level: headingLevel, children:
// translators: refers to a social post on Tumblr
__('Your post', 'social-previews') }), _jsx("p", { className: "social-preview__section-desc", children: __('This is what your social post will look like on Tumblr:', 'social-previews') }), hasMedia ? _jsx(TumblrPostPreview, { ...props }) : _jsx(TumblrLinkPreview, { ...props })] })), !hideLinkPreview && (_jsxs("section", { className: "social-preview__section tumblr-preview__section", children: [_jsx(SectionHeading, { level: headingLevel, children:
// translators: refers to a link on Tumblr
__('Link preview', 'social-previews') }), _jsx("p", { className: "social-preview__section-desc", children: __('This is what it will look like when someone shares the link to your WordPress post on Tumblr.', 'social-previews') }), _jsx(TumblrLinkPreview, { ...props, user: undefined })] }))] }));
};
//# sourceMappingURL=previews.js.map