@embedreach/components 0.3.28 → 0.3.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.
@@ -119137,6 +119137,18 @@ const ChannelDisabledWarning = ({
119137
119137
  const defaultDescription = `Enable the ${channelType} channel to send messages.`;
119138
119138
  const automation2 = useAutomation();
119139
119139
  const canEditAutomation = automation2?.status === AutomationStatus.DRAFT;
119140
+ const renderButton = () => {
119141
+ return /* @__PURE__ */ jsx(
119142
+ Button$1,
119143
+ {
119144
+ size: "sm",
119145
+ onClick: onEnable,
119146
+ disabled: isEnabling || !canEditAutomation,
119147
+ className: "bg-amber-600 hover:bg-amber-700 text-white ml-4 shrink-0",
119148
+ children: isEnabling ? "Enabling..." : `Enable ${channelType === "email" ? "Email" : "SMS"}`
119149
+ }
119150
+ );
119151
+ };
119140
119152
  return /* @__PURE__ */ jsx("div", { className: "px-4 w-full", children: /* @__PURE__ */ jsx("div", { className: "max-w-2xl mx-auto", children: /* @__PURE__ */ jsx(
119141
119153
  "div",
119142
119154
  {
@@ -119159,16 +119171,15 @@ const ChannelDisabledWarning = ({
119159
119171
  /* @__PURE__ */ jsx("h5", { className: "text-sm font-medium mb-1", children: title2 || defaultTitle }),
119160
119172
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: description2 || defaultDescription })
119161
119173
  ] }),
119162
- onEnable && /* @__PURE__ */ jsx(
119163
- Button$1,
119174
+ onEnable && /* @__PURE__ */ jsx(Fragment$1, { children: canEditAutomation ? renderButton() : /* @__PURE__ */ jsx(
119175
+ InfoTooltip,
119164
119176
  {
119165
- size: "sm",
119166
- onClick: onEnable,
119167
- disabled: isEnabling || !canEditAutomation,
119168
- className: "bg-amber-600 hover:bg-amber-700 text-white ml-4 shrink-0",
119169
- children: isEnabling ? "Enabling..." : `Enable ${channelType === "email" ? "Email" : "SMS"}`
119177
+ alertText: "You can only edit the content if we are in the draft state.",
119178
+ asChild: true,
119179
+ className: "cursor-not-allowed",
119180
+ children: renderButton()
119170
119181
  }
119171
- )
119182
+ ) })
119172
119183
  ] }) })
119173
119184
  ] })
119174
119185
  }