import React__default, { Children } from "react";
import useStyles from "./styles.mjs";
import { useProps } from "../../node_modules/.pnpm/@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";
function MediaQuery(props) {
  var _a;
  const { children, smallerThan, largerThan, query, styles, className } = useProps("MediaQuery", {}, props);
  const { classes, cx } = useStyles({ smallerThan, largerThan, query, styles });
  if (children === void 0) {
    return null;
  }
  const child = Children.only(children);
  if (typeof child === "object" && child !== null && "props" in child) {
    return React__default.cloneElement(child, {
      className: cx(classes.media, (_a = child.props) == null ? void 0 : _a.className, className)
    });
  }
  return child;
}
export {
  MediaQuery
};
