@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
19 lines • 718 B
JavaScript
import React from 'react';
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
import { SortingIcon } from '@atlaskit/editor-common/table';
export const SortingIconWrapper = props => {
const {
mode
} = useSharedPluginStateWithSelector(props.api, ['editorViewMode'], states => {
var _states$editorViewMod;
return {
mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
};
});
if (mode === 'edit') {
return null;
}
// Ignored via go/ees005
// eslint-disable-next-line react/jsx-props-no-spreading
return /*#__PURE__*/React.createElement(SortingIcon, props);
};