UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

41 lines (40 loc) 1.08 kB
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