/** * NOTE. This file is based on the “regular” editor. Some features * have been removed, because they don’t make sense on reusable * messages. * * Class names are those of the regular editor (which means no * style is necessary). The tutorial walkthrough has been removed * as well. */ /** * WordPress dependencies */ import { useDispatch, useSelect } from '@safe-wordpress/data'; import { _x, sprintf } from '@safe-wordpress/i18n'; /** * External dependencies */ import { LoadingModal } from '@nelio-content/components'; import { useIsSubscribed } from '@nelio-content/data'; /** * Internal dependencies */ import { useIsLoadingRelatedPost, useIsSaving, useRelatedPostStatus, } from '../../../hooks'; import { store as NC_SOCIAL_EDITOR } from '../../../store'; import { ErrorDetector } from '../../error-detector'; import { MessageEditor } from '../../message-editor'; import { MessagePreview } from '../../message-preview'; import { SingleProfileSelector } from '../../profile-selector/single'; import { Actions } from './actions'; import { QuickActions } from './quick-actions'; import { TimeSelector } from './time-selector'; export const ReusableEditorDialog = (): JSX.Element => { const isLoadingRelatedPost = useIsLoadingRelatedPost(); const isSaving = useIsSaving(); const isSubscribed = useIsSubscribed(); const relatedPostStatus = useRelatedPostStatus(); const { close } = useDispatch( NC_SOCIAL_EDITOR ); const title =