"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useClipboard = require("../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-clipboard/use-clipboard.cjs");
const defaultProps = {
  timeout: 1e3
};
function CopyButton(props) {
  const { children, timeout, value, ...others } = useProps.useProps("CopyButton", defaultProps, props);
  const clipboard = useClipboard.useClipboard({ timeout });
  const copy = () => clipboard.copy(value);
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: children({ copy, copied: clipboard.copied, ...others }) });
}
CopyButton.displayName = "@mantine/core/CopyButton";
exports.CopyButton = CopyButton;
