import CheckCircleOutlined from '../../../../../../node_modules/@mui/icons-material/esm/CheckCircleOutlined.mjs';
import FileCopyOutlined from '../../../../../../node_modules/@mui/icons-material/esm/FileCopyOutlined.mjs';
import React__default, { useState } from 'react';
import styled from '../../../../../../node_modules/@mui/material/styles/styled.mjs';

const CheckCircle = styled(CheckCircleOutlined)({
    display: 'block !important'
});
const useClickToCopyCore = ({ iconSize = 'small', text })=>{
    const [copied, setCopied] = useState(false);
    const copyToClipboard = (e)=>{
        e.stopPropagation();
        setCopied(true);
        navigator.clipboard.writeText(text);
        setTimeout(()=>setCopied(false), 1000);
    };
    const CopyIcon = copied ? /*#__PURE__*/ React__default.createElement(CheckCircle, {
        fontSize: iconSize
    }) : /*#__PURE__*/ React__default.createElement(FileCopyOutlined, {
        fontSize: iconSize
    });
    return {
        copied,
        copyToClipboard,
        CopyIcon
    };
};

export { useClickToCopyCore };
//# sourceMappingURL=clickToCopyUtils.mjs.map
