synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
41 lines (40 loc) • 1.08 kB
JavaScript
import { jsx as r } from "react/jsx-runtime";
import { copyStringToClipboard as l } from "../utils/functions/StringUtils.js";
import { Tooltip as n, IconButton as a } from "@mui/material";
import { createRef as f } from "react";
import d from "./IconSvg/IconSvg.js";
import { displayToast as m } from "./ToastMessage/ToastMessage.js";
function g({
value: i,
sizePx: o = 16,
...p
}) {
const t = f();
return /* @__PURE__ */ r(n, { title: "Copy to Clipboard", children: /* @__PURE__ */ r(
a,
{
ref: t,
...p,
onClick: ((C, c) => (e) => {
e.preventDefault(), l(c).then(() => {
m("Successfully copied to clipboard", "success");
});
})(t, i),
"aria-label": "Copy to clipboard",
children: /* @__PURE__ */ r(
d,
{
icon: "contentCopy",
wrap: !1,
fontSize: "inherit",
sx: o ? { width: `${o}px`, height: `${o}px` } : void 0
}
)
}
) });
}
export {
g as CopyToClipboardIcon,
g as default
};
//# sourceMappingURL=CopyToClipboardIcon.js.map