@automattic/social-previews
Version:
A suite of components to generate previews for a post for both social and search engines.
8 lines • 591 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { __ } from '@wordpress/i18n';
import { formatThreadsDate } from '../helpers';
export const Header = ({ name, date }) => {
const postDate = date || new Date();
return (_jsxs("div", { className: "threads-preview__header", children: [_jsx("span", { className: "threads-preview__name", children: name || __('Account Name', 'social-previews') }), _jsx("time", { className: "threads-preview__date", dateTime: postDate.toISOString(), children: formatThreadsDate(postDate) })] }));
};
//# sourceMappingURL=header.js.map