UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 639 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("clsx"),t=require("../hooks/useClipboardCopy.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(o);const a="NexusCodeCopyButton";exports.default=function(o){const{code:s,...c}=o,{copy:u,isCopied:p}=t.default();return e.jsxs("button",{...c,"aria-label":"Copy the code",type:"button",className:r.default(`${a}-root`,"code-copy"),onClick:async e=>{e.stopPropagation(),await u(s)},children:[p?"Copied":"Copy"," ",e.jsx("span",{className:r.default(`${a}-copyKeypress`,"code-copyKeypress")})]})};