@embedreach/components 0.3.27 → 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.
- package/dist/chunks/index.js +21 -8
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/chunks/index.js
CHANGED
|
@@ -119135,6 +119135,20 @@ const ChannelDisabledWarning = ({
|
|
|
119135
119135
|
}) => {
|
|
119136
119136
|
const defaultTitle = `${channelType === "email" ? "Email" : "SMS"} Channel Disabled`;
|
|
119137
119137
|
const defaultDescription = `Enable the ${channelType} channel to send messages.`;
|
|
119138
|
+
const automation2 = useAutomation();
|
|
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
|
+
};
|
|
119138
119152
|
return /* @__PURE__ */ jsx("div", { className: "px-4 w-full", children: /* @__PURE__ */ jsx("div", { className: "max-w-2xl mx-auto", children: /* @__PURE__ */ jsx(
|
|
119139
119153
|
"div",
|
|
119140
119154
|
{
|
|
@@ -119157,16 +119171,15 @@ const ChannelDisabledWarning = ({
|
|
|
119157
119171
|
/* @__PURE__ */ jsx("h5", { className: "text-sm font-medium mb-1", children: title2 || defaultTitle }),
|
|
119158
119172
|
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: description2 || defaultDescription })
|
|
119159
119173
|
] }),
|
|
119160
|
-
onEnable && /* @__PURE__ */ jsx(
|
|
119161
|
-
|
|
119174
|
+
onEnable && /* @__PURE__ */ jsx(Fragment$1, { children: canEditAutomation ? renderButton() : /* @__PURE__ */ jsx(
|
|
119175
|
+
InfoTooltip,
|
|
119162
119176
|
{
|
|
119163
|
-
|
|
119164
|
-
|
|
119165
|
-
|
|
119166
|
-
|
|
119167
|
-
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()
|
|
119168
119181
|
}
|
|
119169
|
-
)
|
|
119182
|
+
) })
|
|
119170
119183
|
] }) })
|
|
119171
119184
|
] })
|
|
119172
119185
|
}
|