import { Suspense, lazy } from 'react';
import { render } from '@ablogcms/react-utils';
import Portal from '@ablogcms/components/portal';

export default function dispatchTooltip() {
  const element = document.createDocumentFragment();

  const TooltipManager = lazy(
    () => import(/* webpackChunkName: "tooltip-manager" */ '@ablogcms/tooltip/tooltip-manager')
  );

  render(
    <Suspense fallback={null}>
      <Portal>
        <TooltipManager />
      </Portal>
    </Suspense>,
    element
  );
}
