/**
 * 
 * @file Sidebar Toggle component
 * @author Box
 */

import * as React from 'react';
import { withRouter } from 'react-router-dom';
import SidebarToggleButton from '../../components/sidebar-toggle-button/SidebarToggleButton';
import { SIDEBAR_NAV_TARGETS } from '../common/interactionTargets';
const SidebarToggle = ({
  history,
  isOpen
}) => {
  return /*#__PURE__*/React.createElement(SidebarToggleButton, {
    "data-resin-target": SIDEBAR_NAV_TARGETS.TOGGLE,
    "data-testid": "sidebartoggle"
    // $FlowFixMe
    ,
    isOpen: isOpen,
    onClick: event => {
      event.preventDefault();
      history.replace({
        state: {
          open: !isOpen
        }
      });
    }
  });
};
export { SidebarToggle as SidebarToggleComponent };
export default withRouter(SidebarToggle);
//# sourceMappingURL=SidebarToggle.js.map