/**
* WordPress dependencies
*/
import { Button, Dashicon, Spinner, Tooltip } from '@safe-wordpress/components';
import { useSelect, useDispatch } from '@safe-wordpress/data';
import { useMemo } from '@safe-wordpress/element';
import { _x, sprintf } from '@safe-wordpress/i18n';
/**
* External dependencies
*/
import { EMPTY_ARRAY } from '@nelio-content/constants';
import { store as NC_DATA, useFeatureGuard } from '@nelio-content/data';
import { store as NC_SOCIAL_EDITOR } from '@nelio-content/social-message-editor';
import type { PostId } from '@nelio-content/types';
/**
* Internal dependencies
*/
import './style.scss';
export type SocialQueueProps = {
readonly className: string;
readonly postId: PostId;
};
export const SocialQueue = ( {
className,
postId,
}: SocialQueueProps ): JSX.Element => {
const isLoading = useIsLoading( postId );
const canCreateMessages = useCanCreateMessages( postId );
const { published, total } = useMessageCount( postId );
const createMessage = useMessageCreator( postId );
if ( isLoading ) {
return (
);
}
return (
{ _x( 'Social Queue', 'text', 'nelio-content' ) }
{ total - published }
{ published !== total
? sprintf(
/* translators: %1$d: Number of social messages sent. %2$d: Total number of social messages. */
_x( 'Sent: %1$d/%2$d', 'text', 'nelio-content' ),
published,
total
)
: sprintf(
/* translators: %d: Number of social messages sent. */
_x( 'Sent: %d', 'text', 'nelio-content' ),
published
) }