import type { ReactNode } from 'react';
import { createPortal } from 'react-dom';

/** Keeps fixed dialogs outside animated and scrolling route containers. */
export function ModalPortal({ children }: { children: ReactNode }) {
  if (typeof document === 'undefined') return <>{children}</>;
  return createPortal(children, document.body);
}
