import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Icon } from "@powerhousedao/design-system";
import { useCopyToClipboard } from "usehooks-ts";
export function DocId(props) {
    const { docId, onCopy } = props;
    const [, copy] = useCopyToClipboard();
    function handleCopy(text) {
        return () => {
            copy(text)
                .then(() => {
                onCopy?.();
            })
                .catch((error) => {
                console.error("Failed to copy!", error);
            });
        };
    }
    return (_jsxs("button", { className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-slate-50 pl-1 pr-2 text-xs text-stone-300", onClick: handleCopy(docId), children: [_jsx(Icon, { name: "Link" }), "DOC ID", _jsx("span", { className: "text-gray-900", children: docId })] }));
}
//# sourceMappingURL=doc-id.js.map