synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
41 lines (40 loc) • 1.27 kB
JavaScript
import { jsxs as l, jsx as o } from "react/jsx-runtime";
import { Stack as a, Typography as c, Tooltip as s } from "@mui/material";
import { useState as d } from "react";
import m from "../IconSvg/IconSvg.js";
import { copyStringToClipboard as y } from "../../utils/functions/StringUtils.js";
function b(r) {
const { value: t, typographyVariant: p = "smallText1" } = r, [i, e] = d("Copy to clipboard");
return /* @__PURE__ */ l(
a,
{
direction: "row",
spacing: 0.5,
sx: {
alignItems: "center",
display: "inline-flex"
},
children: [
/* @__PURE__ */ o(c, { component: "span", variant: p, children: t }),
/* @__PURE__ */ o(s, { title: i, placement: "top", children: /* @__PURE__ */ o(
"span",
{
role: "button",
style: { cursor: "pointer" },
onClick: (n) => {
n.preventDefault(), y(t).then(() => {
e("Copied to clipboard");
});
},
children: /* @__PURE__ */ o(m, { icon: "contentCopy", wrap: !1, sx: { width: "16px" } })
}
) })
]
}
);
}
export {
b as CopyToClipboardString,
b as default
};
//# sourceMappingURL=CopyToClipboardString.js.map