@automattic/social-previews
Version:
A suite of components to generate previews for a post for both social and search engines.
13 lines • 1.57 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { __ } from '@wordpress/i18n';
import { SectionHeading } from '../shared/section-heading';
import { MastodonLinkPreview } from './link-preview';
import { MastodonPostPreview } from './post-preview';
export const MastodonPreviews = ({ headingLevel, hidePostPreview, hideLinkPreview, ...props }) => {
return (_jsxs("div", { className: "social-preview mastodon-preview", children: [!hidePostPreview && (_jsxs("section", { className: "social-preview__section mastodon-preview__section", children: [_jsx(SectionHeading, { level: headingLevel, children:
// translators: refers to a social post on Mastodon
__('Your post', 'social-previews') }), _jsx("p", { className: "social-preview__section-desc", children: __('This is what your social post will look like on Mastodon:', 'social-previews') }), _jsx(MastodonPostPreview, { ...props })] })), !hideLinkPreview && (_jsxs("section", { className: "social-preview__section mastodon-preview__section", children: [_jsx(SectionHeading, { level: headingLevel, children:
// translators: refers to a link to a Mastodon post
__('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 Mastodon.', 'social-previews') }), _jsx(MastodonLinkPreview, { ...props, user: undefined })] }))] }));
};
//# sourceMappingURL=previews.js.map