import React, { useCallback } from 'react';
import { CellRichContentInput } from '@wix/patterns-fields/cell-rich-content-input';
import { RichContentView } from './View';
export const RichContentEdit = ({ value, onChange, onCommit, 
// onCancel intentionally unused: Escape commits via RichContentEditor.onClose -> editorRef.prePublish().
editTrigger, columnId, rowKey, }) => {
    const initialTypedKey = editTrigger &&
        typeof editTrigger === 'object' &&
        editTrigger.kind === 'type'
        ? editTrigger.key
        : undefined;
    const handleSave = useCallback(() => {
        onCommit();
    }, [onCommit]);
    return (React.createElement(React.Fragment, null,
        React.createElement(RichContentView, { value: value, columnId: columnId, rowKey: rowKey }),
        React.createElement(CellRichContentInput, { value: value, onChange: onChange, onSave: handleSave, initialTypedKey: initialTypedKey })));
};
export default RichContentEdit;
//# sourceMappingURL=Edit.js.map