// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

import { useContext } from 'react';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import DistractionFreeModeContext from '../DistractionFreeModeContext';
import { jsx as _jsx } from "react/jsx-runtime";
/**
 * `ToolbarExpander` is a part of the [Toolbar](#!/Toolbar) component.
 * It is used to split all toolbar controls into two groups:
 * all controls before ToolbarExpander are aligned left, and all controls after ToolbarExpander are aligned right.
 * @since 0.0.57
 */
const ToolbarExpander = _ref => {
  let {
    baseClassName = `${CLS_PREFIX}toolbar__expander`,
    className,
    children,
    ...props
  } = _ref;
  const distractionFreeMode = useContext(DistractionFreeModeContext);
  if (distractionFreeMode && distractionFreeMode.enabled) {
    return null;
  }
  return /*#__PURE__*/_jsx("div", {
    className: classNames(baseClassName, className),
    ...props,
    children: children
  });
};
export default ToolbarExpander;