import { useToast } from "../toast/useToast.js";

//#region src/copyToClipboard/useCopyToClipboard.ts
const useCopyToClipboard = (copyText) => {
	const { showSuccess, showError } = useToast();
	const isCopyDisabled = !window?.navigator?.clipboard?.writeText;
	const copy = () => {
		if (!isCopyDisabled) window?.navigator?.clipboard.writeText?.(copyText).then(() => showSuccess(`Copied to clipboard: ${copyText}`)).catch(() => showError("Copy failed"));
	};
	return {
		copy,
		isCopyDisabled
	};
};

//#endregion
export { useCopyToClipboard };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=useCopyToClipboard.js.map