/** * WordPress dependencies */ import { Button, Modal } from '@safe-wordpress/components'; import { useDispatch, useSelect } from '@safe-wordpress/data'; import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import { ContextualHelp, SaveButton } from '@nelio-content/components'; /** * Internal dependencies */ import './style.scss'; import { store as NC_TASK_EDITOR } from './store'; import { walkthrough } from './walkthrough'; import { Assignee } from './components/assignee'; import { DateDue } from './components/date-due'; import { ErrorDetector } from './components/error-detector'; import { MaybeRelatedPost } from './components/maybe-related-post'; import { TaskColor } from './components/task-color'; import { TaskDescriptionEditor } from './components/task-description-editor'; export * from './store'; export type TaskEditorProps = { readonly className?: string; }; export const TaskEditor = ( { className = '', }: TaskEditorProps ): JSX.Element | null => { const error = useSelect( ( select ) => select( NC_TASK_EDITOR ).getValidationError(), [] ); const isVisible = useSelect( ( select ) => select( NC_TASK_EDITOR ).isVisible(), [] ); const isSaving = useSelect( ( select ) => select( NC_TASK_EDITOR ).isSaving(), [] ); const isExistingTask = useSelect( ( select ) => ! select( NC_TASK_EDITOR ).isNewTask(), [] ); const isExistingTaskDirty = useSelect( ( select ) => select( NC_TASK_EDITOR ).isDirty(), [] ); const { close, saveAndClose } = useDispatch( NC_TASK_EDITOR ); const title =