UNPKG

@payfit/unity-components

Version:

28 lines (27 loc) • 1.11 kB
import { CircularIconButton as e } from "../../../../../core/components/icon-button/CircularIconButton.js"; import { useAIComposerContext as t } from "../AIComposer.context.js"; import { forwardRef as n } from "react"; import { uyTv as r } from "@payfit/unity-themes"; import { jsx as i } from "react/jsx-runtime"; import { useIntl as a } from "react-intl"; //#region src/modules/ai-kit/components/ai-composer/parts/AIComposerAction.tsx var o = r({ base: ["uy:data-[disabled=\"true\"]:bg-surface-neutral-lowest-disabled"] }), s = (e, t, n) => e ?? t ?? n, c = n(({ icon: n, title: r, "aria-label": c, isDisabled: l, ...u }, d) => { let f = a(), { state: p } = t(), m = s(r, c, f.formatMessage({ id: "unity:module:ai-kit:composer:action", defaultMessage: "Composer action" })), h = o(); return /* @__PURE__ */ i(e, { ...u, ref: d, asElement: "button", icon: n, title: m, "aria-label": c, isDisabled: l || p === "disabled", className: h, color: "content.neutral.lowest" }); }); c.displayName = "AIComposerAction"; //#endregion export { c as AIComposerAction, s as getActionTitle };