import React, { useMemo } from 'react';

// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
import { ThemeProvider } from '@emotion/react';
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
import { WidthConsumer } from '../WidthProvider';
export function mapBreakpointToLayoutMaxWidth(breakpoint) {
  switch (breakpoint) {
    case 'M':
    case 'L':
      return 760;
    default:
      return 680;
  }
}
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
export function BaseThemeWrapper({
  baseFontSize,
  children
}) {
  const memoizedTheme = useMemo(() => ({
    baseFontSize: baseFontSize || 14,
    layoutMaxWidth: akEditorDefaultLayoutWidth
  }), [baseFontSize]);
  return /*#__PURE__*/React.createElement(ThemeProvider, {
    theme: memoizedTheme
  }, children);
}
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
export function BaseTheme({
  children,
  baseFontSize
}) {
  return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
    breakpoint
  }) => /*#__PURE__*/React.createElement(BaseThemeWrapper, {
    breakpoint: breakpoint,
    baseFontSize: baseFontSize
  }, /*#__PURE__*/React.createElement(React.Fragment, null, children)));
}