@embedreach/components 0.2.18 → 0.2.19

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.
@@ -2705,14 +2705,16 @@ const listBusinessAutomations = async (args) => {
2705
2705
  );
2706
2706
  return response.data;
2707
2707
  };
2708
- const duplicateBusinessAutomation = async (automationId) => {
2708
+ const duplicateBusinessAutomation = async (automationId, name, description2) => {
2709
2709
  const response = await baseRequest(
2710
2710
  `${BUSINESS_AUTOMATION_PATH}`,
2711
2711
  {
2712
2712
  method: "POST",
2713
2713
  body: JSON.stringify({
2714
2714
  duplicate: true,
2715
- source_id: automationId
2715
+ source_id: automationId,
2716
+ name,
2717
+ description: description2
2716
2718
  })
2717
2719
  }
2718
2720
  );
@@ -72865,11 +72867,7 @@ const RecipientsTable = ({ recipients }) => {
72865
72867
  /* @__PURE__ */ jsx("th", { className: "px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide", children: "Contact" })
72866
72868
  ] }) }),
72867
72869
  /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200/50", children: recipients.map((recipient, index2) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-white/50 transition-colors", children: [
72868
- /* @__PURE__ */ jsxs("td", { className: "px-3 sm:px-4 py-3 text-sm text-gray-900", children: [
72869
- recipient.firstName,
72870
- " ",
72871
- recipient.lastName
72872
- ] }),
72870
+ /* @__PURE__ */ jsx("td", { className: "px-3 sm:px-4 py-3 text-sm text-gray-900", children: recipient.firstName || recipient.lastName ? `${recipient.firstName || ""} ${recipient.lastName || ""}`.trim() : "Not Provided" }),
72873
72871
  /* @__PURE__ */ jsx("td", { className: "px-3 sm:px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5 sm:gap-2", children: [
72874
72872
  recipient.email && /* @__PURE__ */ jsx("span", { className: "px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg", children: "Email" }),
72875
72873
  recipient.phone && /* @__PURE__ */ jsx("span", { className: "px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg", children: "Phone" })
@@ -82401,16 +82399,18 @@ function AutomationDuplicateDialog({
82401
82399
  description: automation2?.description ?? ""
82402
82400
  }
82403
82401
  });
82404
- async function onSubmit() {
82405
- if (!automation2) {
82402
+ async function onSubmit(values) {
82403
+ if (!automation2 || !values.name) {
82406
82404
  toast2({
82407
82405
  title: "Error duplicating automation",
82408
- description: "Please try again"
82406
+ description: "Please try again. Please make sure to fill in the name of the automation."
82409
82407
  });
82410
82408
  return;
82411
82409
  }
82412
82410
  const { id: duplicatedId } = await duplicateBusinessAutomation(
82413
- automation2.id
82411
+ automation2.id,
82412
+ values.name,
82413
+ values.description
82414
82414
  );
82415
82415
  if (!duplicatedId) {
82416
82416
  toast2({
@@ -82439,7 +82439,6 @@ function AutomationDuplicateDialog({
82439
82439
  {
82440
82440
  control: form.control,
82441
82441
  name: "name",
82442
- disabled: true,
82443
82442
  render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
82444
82443
  /* @__PURE__ */ jsx(FormLabel, { children: "Title" }),
82445
82444
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
@@ -82452,7 +82451,6 @@ function AutomationDuplicateDialog({
82452
82451
  {
82453
82452
  control: form.control,
82454
82453
  name: "description",
82455
- disabled: true,
82456
82454
  render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
82457
82455
  /* @__PURE__ */ jsx(FormLabel, { children: "Description" }),
82458
82456
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),