@wealthx/shadcn 1.5.28 → 1.5.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -534,6 +534,7 @@ function ChatComposer({
534
534
  emailReplySubject,
535
535
  className
536
536
  }) {
537
+ const initialChannelRef = React.useRef(channelProp);
537
538
  const [channel, setChannel] = React.useState(
538
539
  isEmailIntegrated ? channelProp : "chat"
539
540
  );
@@ -731,35 +732,29 @@ function ChatComposer({
731
732
  /* @__PURE__ */ jsx3(ComposerLinkPopover, { editor }),
732
733
  /* @__PURE__ */ jsx3(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
733
734
  ] }),
734
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
735
- onLetAiHandle && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
736
- /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
737
- "Let AI Handle"
738
- ] }),
739
- /* @__PURE__ */ jsxs2(
740
- Button,
741
- {
742
- size: "sm",
743
- onClick: () => {
744
- var _a;
745
- const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
746
- onSendEmail == null ? void 0 : onSendEmail({
747
- content: html,
748
- to: emailTo,
749
- cc: emailCc,
750
- subject: emailSubject,
751
- isReply: emailMode === "reply"
752
- });
753
- editor == null ? void 0 : editor.commands.clearContent();
754
- },
755
- disabled: !editor || editor.isEmpty || !emailTo.trim(),
756
- children: [
757
- /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
758
- "Send Email"
759
- ]
760
- }
761
- )
762
- ] })
735
+ /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs2(
736
+ Button,
737
+ {
738
+ size: "sm",
739
+ onClick: () => {
740
+ var _a;
741
+ const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
742
+ onSendEmail == null ? void 0 : onSendEmail({
743
+ content: html,
744
+ to: emailTo,
745
+ cc: emailCc,
746
+ subject: emailSubject,
747
+ isReply: emailMode === "reply"
748
+ });
749
+ editor == null ? void 0 : editor.commands.clearContent();
750
+ },
751
+ disabled: !editor || editor.isEmpty || !emailTo.trim(),
752
+ children: [
753
+ /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
754
+ "Send Email"
755
+ ]
756
+ }
757
+ ) })
763
758
  ] })
764
759
  ]
765
760
  }
@@ -775,7 +770,7 @@ function ChatComposer({
775
770
  }
776
771
  ),
777
772
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between", children: [
778
- /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
773
+ initialChannelRef.current !== "email" && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
779
774
  /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
780
775
  "Let AI Handle"
781
776
  ] }),
@@ -783,6 +778,7 @@ function ChatComposer({
783
778
  Button,
784
779
  {
785
780
  size: "sm",
781
+ className: "ml-auto",
786
782
  onClick: () => onSend == null ? void 0 : onSend(inputValue),
787
783
  disabled: !inputValue.trim(),
788
784
  children: [
@@ -899,7 +895,7 @@ function ChatThread({
899
895
  /* @__PURE__ */ jsxs2("div", { className: "hidden items-center gap-2 md:flex", children: [
900
896
  isClosed && /* @__PURE__ */ jsx3(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
901
897
  !isClosed && aiIsHandling && /* @__PURE__ */ jsx3(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
902
- !isClosed && !aiIsHandling && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
898
+ !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
903
899
  /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
904
900
  "Let AI Handle"
905
901
  ] })