/**
 * 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, PremiumDialog } from '@nelio-content/components';

/**
 * WordPress dependencies
 */
import { PluginPostStatusInfo } from '@safe-wordpress/editor';

/**
 * Internal dependencies
 */
import { PostStatusInfo } from './post-status-info';
import { PrePublishChecks } from './pre-publish-checks';
import { ToolsSidebar } from './tools-sidebar';
import { SocialSidebar } from './social-sidebar';
import ExtendedPostStatus from './extended-post-status';
import './style.scss';

export type LayoutProps = {
	readonly isQualityFullyIntegrated?: boolean;
};

export const Layout = ( {
	isQualityFullyIntegrated,
}: LayoutProps ): JSX.Element => {
	const FutureActionEditor = getPremiumComponent(
		'post-page/future-action-editor',
		'null'
	);
	return (
		<>
			<PluginPostStatusInfo>
				<ExtendedPostStatus />
			</PluginPostStatusInfo>

			<PostStatusInfo
				isQualityFullyIntegrated={ isQualityFullyIntegrated }
			/>
			<PrePublishChecks />

			<ToolsSidebar />
			<SocialSidebar />

			<ReferenceEditor />
			<SocialMessageEditor />
			<TaskEditor />
			<FutureActionEditor />

			<PremiumDialog />
		</>
	);
};
