import { jsx, Fragment } from "react/jsx-runtime";
import "react";
import "clsx";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useClipboard } from "../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-clipboard/use-clipboard.mjs";
const defaultProps = {
  timeout: 1e3
};
function CopyButton(props) {
  const { children, timeout, value, ...others } = useProps("CopyButton", defaultProps, props);
  const clipboard = useClipboard({ timeout });
  const copy = () => clipboard.copy(value);
  return /* @__PURE__ */ jsx(Fragment, { children: children({ copy, copied: clipboard.copied, ...others }) });
}
CopyButton.displayName = "@mantine/core/CopyButton";
export {
  CopyButton
};
