import { jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import clsx from "clsx";
import { CloseButton } from "../CloseButton/CloseButton.mjs";
import { useModalBaseContext } from "./ModalBase.context.mjs";
import classes from "./ModalBase.module.css.mjs";
const ModalBaseCloseButton = forwardRef(
  ({ className, onClick, ...others }, ref) => {
    const ctx = useModalBaseContext();
    return /* @__PURE__ */ jsx(
      CloseButton,
      {
        ref,
        ...others,
        onClick: (event) => {
          ctx.onClose();
          onClick == null ? void 0 : onClick(event);
        },
        className: clsx({ [classes.close]: !ctx.unstyled }, className),
        unstyled: ctx.unstyled
      }
    );
  }
);
ModalBaseCloseButton.displayName = "@mantine/core/ModalBaseCloseButton";
export {
  ModalBaseCloseButton
};
