import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { useUIState, useConfigState } from '@sentecacommerce-theme/lib';
import dynamic from 'next/dynamic';
import { Spinner } from '..';
export var Views = () => {
  var {
    views
  } = useUIState();
  var {
    views: configViews
  } = useConfigState();
  var viewsMap = React.useMemo(() => {
    return {
      [configViews.auth]: dynamic(() => import('../Modals').then(mod => mod.AuthPopup), {
        loading: () => /*#__PURE__*/React.createElement(Spinner, null),
        ssr: false
      }),
      [configViews.storePickUp]: dynamic(() => import('../Modals').then(mod => mod.PickUpFromStore), {
        loading: () => /*#__PURE__*/React.createElement(Spinner, null),
        ssr: false
      }),
      [configViews.itemDesc]: dynamic(() => import('../Modals').then(mod => mod.ItemDescription), {
        loading: () => /*#__PURE__*/React.createElement(Spinner, null),
        ssr: false
      }),
      [configViews.bagModal]: dynamic(() => import('../Modals').then(mod => mod.AddToBagModal), {
        loading: () => /*#__PURE__*/React.createElement(Spinner, null),
        ssr: false
      }),
      [configViews.subForProduct]: dynamic(() => import('../Modals').then(mod => mod.SubscribeForProduct), {
        loading: () => /*#__PURE__*/React.createElement(Spinner, null),
        ssr: false
      })
    };
  }, []);
  return /*#__PURE__*/React.createElement(React.Fragment, null, views == null ? void 0 : views.map(item => {
    return /*#__PURE__*/React.createElement(viewsMap[item.id], _extends({}, item.props, {
      key: item.id
    }));
  }));
};
//# sourceMappingURL=index.js.map