import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Icon } from "@powerhousedao/design-system";
import { useCopyToClipboard } from "usehooks-ts";
import { ConnectTooltip } from "../../tooltip/tooltip.js";
export function RevisionNumber(props) {
    const { operationIndex, eventId, stateHash } = props;
    const [, copy] = useCopyToClipboard();
    const revisionNumber = operationIndex + 1;
    const tooltipContent = (_jsxs("button", { className: "flex items-center gap-1", onClick: handleCopy(stateHash), children: ["Revision ", revisionNumber, " - Event ID: ", eventId, " - State Hash: ", stateHash, _jsx(Icon, { className: "inline-block text-gray-600", name: "FilesEarmark", size: 16 })] }));
    function handleCopy(text) {
        return () => {
            copy(text).catch((error) => {
                console.error("Failed to copy!", error);
            });
        };
    }
    return (_jsx(ConnectTooltip, { content: tooltipContent, children: _jsxs("span", { className: "flex cursor-pointer items-center gap-2 text-xs text-gray-600", children: ["Revision ", revisionNumber, ".", _jsx("a", { children: _jsx(Icon, { className: "cursor-pointer text-slate-100", name: "Ellipsis", size: 14 }) })] }) }));
}
//# sourceMappingURL=revision-number.js.map