// packages/core/src/components/dialog/dialog-portal.tsx
import type { JSX } from "solid-js";
import { Portal } from "../../utilities/portal/portal";
import type { DialogPortalProps } from "./dialog.props";

export type { DialogPortalProps };

/** Renders children into a portal (defaults to document.body). */
export function DialogPortal(props: DialogPortalProps): JSX.Element {
  return props.target !== undefined ? (
    <Portal target={props.target}>{props.children}</Portal>
  ) : (
    <Portal>{props.children}</Portal>
  );
}
