UNPKG

@assistant-ui/react

Version:

React components for AI chat.

55 lines (54 loc) 2.29 kB
"use strict"; "use client"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/primitives/actionBar/ActionBarCopy.tsx var ActionBarCopy_exports = {}; __export(ActionBarCopy_exports, { ActionBarPrimitiveCopy: () => ActionBarPrimitiveCopy }); module.exports = __toCommonJS(ActionBarCopy_exports); var import_react = require("react"); var import_useActionBarCopy = require("../../primitive-hooks/actionBar/useActionBarCopy.cjs"); var import_primitive = require("@radix-ui/primitive"); var import_react_primitive = require("@radix-ui/react-primitive"); var import_context = require("../../context/index.cjs"); var import_jsx_runtime = require("react/jsx-runtime"); var ActionBarPrimitiveCopy = (0, import_react.forwardRef)(({ copiedDuration, onClick, disabled, ...props }, forwardedRef) => { const isCopied = (0, import_context.useMessageUtils)((u) => u.isCopied); const callback = (0, import_useActionBarCopy.useActionBarCopy)({ copiedDuration }); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_react_primitive.Primitive.button, { type: "button", ...isCopied ? { "data-copied": "true" } : {}, ...props, ref: forwardedRef, disabled: disabled || !callback, onClick: (0, import_primitive.composeEventHandlers)(onClick, () => { callback?.(); }) } ); }); ActionBarPrimitiveCopy.displayName = "ActionBarPrimitive.Copy"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { ActionBarPrimitiveCopy }); //# sourceMappingURL=ActionBarCopy.js.map