/**
 * WordPress dependencies
 */
import { _x } from '@safe-wordpress/i18n';

/**
 * External dependencies
 */
import { ReferenceEditor } from '@nelio-content/edit-post';
import { SocialMessageEditor } from '@nelio-content/social-message-editor';
import { TaskEditor } from '@nelio-content/task-editor';
import {
	getPremiumComponent,
	PremiumPlaceholderPanel,
} from '@nelio-content/components';

/**
 * Internal dependencies
 */
import { PromoPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/promo';
import { AnalyticsPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/analytics';
import { EditorialCommentsPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/editorial-comments';
import { EditorialTasksPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/editorial-tasks';
import { ExternalFeaturedImagePanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/external-featured-image';
import { NotificationsPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/notifications';
import { QualityAnalysisPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/quality-analysis';
import { ReferencesPanel } from '../../../gutenberg/plugin/components/tools-sidebar/panels/references';
import { PrePublishChecks } from '../../../gutenberg/plugin/components/pre-publish-checks';

export const ToolsSidebar = (): JSX.Element => {
	const SeriesPanel = getPremiumComponent(
		'elementor-editor/series-panel',
		() => (
			<PremiumPlaceholderPanel
				title={ _x( 'Series', 'text', 'nelio-content' ) }
				feature="raw/series"
			/>
		)
	);

	const FutureActionsPanel = getPremiumComponent(
		'elementor-editor/future-actions-panel',
		() => (
			<PremiumPlaceholderPanel
				title={ _x( 'Future Actions', 'text', 'nelio-content' ) }
				feature="raw/future-actions"
			/>
		)
	);

	return (
		<>
			<PrePublishChecks />

			<PromoPanel />
			<QualityAnalysisPanel />
			<AnalyticsPanel />
			<NotificationsPanel />
			<SeriesPanel />
			<FutureActionsPanel />
			<EditorialTasksPanel />
			<EditorialCommentsPanel />
			<ReferencesPanel />
			<ExternalFeaturedImagePanel />

			<ReferenceEditor />
			<SocialMessageEditor />
			<TaskEditor />
		</>
	);
};
