/** * WordPress dependencies */ import { NoticeList, Popover, SlotFillProvider, } from '@safe-wordpress/components'; import { useSelect, useDispatch } from '@safe-wordpress/data'; import { StrictMode } from '@safe-wordpress/element'; import { store as NOTICES } from '@safe-wordpress/notices'; /** * External dependencies */ import { PremiumDialog } from '@nelio-content/components'; import { withSubscriptionCheck } from '@nelio-content/data'; /** * Internal dependencies */ import './style.scss'; import { useArePresetsDirty } from '~/nelio-content-pages/settings/task-presets/hooks'; import { useUnsavedExitEffect } from '~/nelio-content-pages/settings/automations/hooks'; import { TaskPresetList } from '../task-preset-list'; import { TaskTemplateEditor } from '../task-template-editor'; export const Layout = (): JSX.Element => ( ); const InternalLayout = withSubscriptionCheck( 'raw/task-presets', () => { const { notices, removeNotice } = useNotices(); const isDirty = useArePresetsDirty(); useUnsavedExitEffect( isDirty ); return (
); } ); // ===== // HOOKS // ===== const useNotices = () => { const notices = useSelect( ( select ) => select( NOTICES ).getNotices(), [] ); const { removeNotice } = useDispatch( NOTICES ); return { notices, removeNotice }; };