import { jsx } from "react/jsx-runtime";
import { cloneElement } from "react";
import { useDropzoneContext } from "./Dropzone.context.mjs";
import { upperFirst } from "../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/utils/upper-first/upper-first.mjs";
import { useProps } from "../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.mjs";
import { isElement } from "../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/utils/is-element/is-element.mjs";
function createDropzoneStatus(status) {
  const Component = (props) => {
    const { children, ...others } = useProps(`Dropzone${upperFirst(status)}`, {}, props);
    const ctx = useDropzoneContext();
    const _children = isElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
    if (ctx[status]) {
      return cloneElement(_children, others);
    }
    return null;
  };
  Component.displayName = `@mantine/dropzone/${upperFirst(status)}`;
  return Component;
}
const DropzoneAccept = createDropzoneStatus("accept");
const DropzoneReject = createDropzoneStatus("reject");
const DropzoneIdle = createDropzoneStatus("idle");
export {
  DropzoneAccept,
  DropzoneIdle,
  DropzoneReject
};
