UNPKG

@payfit/unity-components

Version:

36 lines (35 loc) • 1.16 kB
import { Card as e } from "../../../../core/components/card/Card.js"; import { ProposalCardContextProvider as t } from "./ProposalCard.context.js"; import { proposalCard as n } from "./ProposalCard.variants.js"; import { forwardRef as r } from "react"; import { jsx as i } from "react/jsx-runtime"; import { Disclosure as a } from "react-aria-components/Disclosure"; //#region src/modules/ai-kit/components/proposal-card/ProposalCard.tsx var o = r(({ children: r, state: o, isExpanded: s, defaultExpanded: c = !1, onExpandedChange: l, ...u }, d) => { let f = o !== "pending", { body: p, disclosure: m } = n(); return /* @__PURE__ */ i(t, { value: { state: o, isExpandable: f }, children: /* @__PURE__ */ i(e, { ref: d, ...u, density: "compact", "data-unity-proposal-state": o, children: f ? /* @__PURE__ */ i(a, { className: ({ isExpanded: e }) => m({ isExpanded: e }), defaultExpanded: c, isExpanded: s, onExpandedChange: l, children: r }) : /* @__PURE__ */ i("div", { className: p(), children: r }) }) }); }); o.displayName = "AIProposalCard"; //#endregion export { o as AIProposalCard };