UNPKG

@automattic/social-previews

Version:

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

11 lines 823 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import clsx from 'clsx'; import { baseDomain } from '../helpers'; import { threadsTitle } from './helpers'; export const Card = ({ image, title, url }) => { const cardClassNames = clsx({ 'threads-preview__card-has-image': !!image, }); return (_jsx("div", { className: "threads-preview__card", children: _jsxs("div", { className: cardClassNames, children: [image && _jsx("img", { className: "threads-preview__card-image", src: image, alt: "" }), _jsxs("div", { className: "threads-preview__card-body", children: [_jsx("div", { className: "threads-preview__card-url", children: baseDomain(url || '') }), _jsx("div", { className: "threads-preview__card-title", children: threadsTitle(title) })] })] }) })); }; //# sourceMappingURL=card.js.map