import "core-js/modules/es.array.iterator.js";
import "core-js/modules/web.dom-collections.iterator.js";
import { useEffect, useState } from 'react';
import { omitUndefined } from '../../utils';
const useCurrentMenuLayoutProps = currentMenu => {
  const [currentMenuLayoutProps, setCurrentMenuLayoutProps] = useState({});
  useEffect(() => {
    setCurrentMenuLayoutProps(omitUndefined({
      // 有时候会变成对象，是原来的方式
      layout: typeof currentMenu.layout !== 'object' ? currentMenu.layout : undefined,
      navTheme: currentMenu.navTheme,
      menuRender: currentMenu.menuRender,
      footerRender: currentMenu.footerRender,
      menuHeaderRender: currentMenu.menuHeaderRender,
      headerRender: currentMenu.headerRender,
      fixSiderbar: currentMenu.fixSiderbar,
      headerTheme: currentMenu.headerTheme
    }));
  }, [currentMenu.layout, currentMenu.navTheme, currentMenu.menuRender, currentMenu.footerRender, currentMenu.menuHeaderRender, currentMenu.headerRender, currentMenu.fixSiderbar, currentMenu.headerTheme]);
  return currentMenuLayoutProps;
};
export default useCurrentMenuLayoutProps;