import React from 'react'; import { useDispatch } from 'react-redux'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; import messages from './messages'; import * as hooks from './hooks'; import supportedEditors from './supportedEditors'; export const Editor = ({ learningContextId, blockType, blockId, lmsEndpointUrl, studioEndpointUrl, onClose, }) => { const dispatch = useDispatch(); hooks.initializeApp({ dispatch, data: { blockId, blockType, learningContextId, lmsEndpointUrl, studioEndpointUrl, }, }); const EditorComponent = supportedEditors[blockType]; return (