import React, { createContext, useContext } from 'react';
const EditorToolbarContext = /*#__PURE__*/createContext({
  editorView: null,
  editorAppearance: undefined,
  editorViewMode: undefined,
  editorToolbarDockingPreference: undefined
});

/**
 * Access editor specific config and state within a toolbar component
 */
export const useEditorToolbar = () => {
  const context = useContext(EditorToolbarContext);
  if (!context) {
    throw new Error('useEditorToolbar must be used within EditorToolbarContext');
  }
  return context;
};
export const EditorToolbarProvider = ({
  children,
  editorView,
  editorAppearance,
  editorViewMode,
  editorToolbarDockingPreference,
  isOffline
}) => {
  return /*#__PURE__*/React.createElement(EditorToolbarContext.Provider, {
    // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
    value: {
      editorView,
      editorAppearance,
      editorViewMode,
      editorToolbarDockingPreference,
      isOffline
    }
  }, children);
};