/** * WordPress dependencies */ import { ExternalLink } from '@safe-wordpress/components'; import { useSelect } from '@safe-wordpress/data'; import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import clsx from 'clsx'; import { AuthorIcon, PostEngagementAnalytics, PostPageviewsAnalytics, PostRefreshAnalyticsAction, } from '@nelio-content/components'; import { useAuthor, usePost, store as NC_DATA } from '@nelio-content/data'; import { dateI18n, getSettings as getDateSettings } from '@nelio-content/date'; import type { PostId } from '@nelio-content/types'; /** * Internal dependencies */ import './style.scss'; import { SocialQueue } from '../../social-queue'; export type PostProps = { readonly postId: PostId; }; export const Post = ( { postId }: PostProps ): JSX.Element | null => { const post = usePost( postId ); const author = useAuthor( post?.author ); const isGAConnected = useSelect( ( select ) => select( NC_DATA ).isGAConnected(), [] ); if ( ! post ) { return null; } const { title, excerpt, permalink, date, imageSrc: image } = post; const authorName = author?.name ?? ''; const authorId = post.author; return (