import React, { useEffect, useId, useRef } from 'react' import { __ } from '@wordpress/i18n' import { useSubmitSnippet } from '../../../../hooks/useSubmitSnippet' import { handleUnknownError } from '../../../../utils/errors' import { isMacOS } from '../../../../utils/screen' import { useSnippetForm } from '../WithSnippetFormContext' import { Button } from '../../../common/Button' import { ExpandIcon } from '../../../common/icons/ExpandIcon' import { MinimiseIcon } from '../../../common/icons/MinimiseIcon' import { CodeEditorShortcuts } from './CodeEditorShortcuts' import type { Dispatch, RefObject, SetStateAction } from 'react' interface EditorTextareaProps { textareaRef: RefObject snippetCodeId: string } const EditorTextarea: React.FC = ({ textareaRef, snippetCodeId }) => { const descriptionId = useId() const { snippet, setSnippet } = useSnippetForm() return (

{__('In the editing area, the Tab key enters a tab character. To exit the code editor, press the Escape key and then the Tab key.', 'code-snippets')}