import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Clipboard } from "./Icons/Clipboard";
import { Col, Row } from "antd";
import { useState } from "react";
import CopyToClipboard from "react-copy-to-clipboard";
export const CopyClipboardHashInput = ({ hash, highlight }) => {
    const [showCopyText, setShowCopyText] = useState(false);
    return (_jsx(CopyToClipboard, { text: window.location.origin + `?invite=${hash}`, children: _jsx("div", { style: highlight ? { position: "relative", cursor: "pointer" } : { position: "relative", cursor: "pointer", width: "200px" }, onClick: () => {
                setShowCopyText(true);
                setTimeout(() => {
                    setShowCopyText(false);
                }, 3000);
            }, children: _jsxs(Row, { align: "middle", children: [_jsx(Col, { children: highlight && (_jsx("p", { className: highlight ? `header-1r` : "header-1r typography-overflow", style: showCopyText || highlight ? { color: "#d7ff65" } : { color: "#fff" }, children: hash })) }), _jsx(Col, { children: _jsx(Clipboard, { fill: showCopyText || highlight ? "#d7ff65" : "#fff" }) }), (showCopyText || highlight) && (_jsx("div", { style: { position: "absolute", bottom: 0, right: 0 }, children: _jsx("p", { className: "paragraph-3r", style: { color: "#d7ff65" }, children: "Copied to clipboard!" }) }))] }) }) }));
};
//# sourceMappingURL=CopyClipboardHashInput.js.map