/** * WordPress dependencies */ import { Dashicon, Tooltip } from '@safe-wordpress/components'; import { useSelect } from '@safe-wordpress/data'; import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import { filter, toPairs } from 'lodash'; import { store as NC_DATA, usePost } from '@nelio-content/data'; import { getSupportedNetworks } from '@nelio-content/networks'; import type { Maybe, Post, PostId, SocialNetworkName, } from '@nelio-content/types'; /** * Internal dependencies */ import './style.scss'; import { SocialNetworkIcon } from '../social-network-icon'; export type PostPageviewsAnalyticsProps = { readonly className?: string; readonly postId: PostId; readonly statistics?: Post[ 'statistics' ]; }; export const PostPageviewsAnalytics = ( { className = '', postId, statistics, }: PostPageviewsAnalyticsProps ): JSX.Element | null => { const isVisible = useIsVisible(); const pageviews = usePageViews( postId, statistics ); const metrics = useMetrics( postId, statistics ); if ( ! isVisible ) { return null; } return (