@capillarytech/creatives-library 8.0.86 → 8.0.87-alpha.1

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.
@@ -80,6 +80,7 @@ export const getWhatsappContent = (template, isPreview) => {
80
80
  header = '',
81
81
  footer = '',
82
82
  } = {},
83
+ carouselData = [],
83
84
  } = {},
84
85
  } = {},
85
86
  } = {},
@@ -125,6 +126,7 @@ export const getWhatsappContent = (template, isPreview) => {
125
126
  quickReplyData: buttonsData
126
127
  }),
127
128
  ...mediaParams,
129
+ carouselData,
128
130
  };
129
131
  };
130
132
 
@@ -188,6 +190,38 @@ export const getWhatsappQuickReply= (template, templatePreview) => {
188
190
  }
189
191
  return renderArray;
190
192
  }
193
+
194
+ export const getWhatsappCarouselButtonView = (buttons, templatePreview) => {
195
+ const renderArray = [];
196
+ if (buttons?.length) {
197
+ renderArray.push(<CapDivider className={templatePreview ? "whatsapp-divider" : "whatsapp-list-view-divider"} />);
198
+ buttons.forEach((button, index) => {
199
+ const { text, buttonType } = button || {};
200
+ if (text) {
201
+ renderArray.push(
202
+ <CapLabel
203
+ type="label21"
204
+ style={{ textAlign: 'center', marginTop: '12px' }}
205
+ // className={templatePreview ? "whatsapp-cta-preview" : "whatsapp-list-quick-reply-preview"}
206
+ >
207
+ <CapIcon
208
+ type={buttonType === PHONE_NUMBER ? 'call' : buttonType === QUICK_REPLY ? "small-link" : 'launch'}
209
+ size="xs"
210
+ svgProps={{ style: { marginRight: '4px' } }}
211
+ />
212
+ {text}
213
+ </CapLabel>,
214
+ );
215
+ }
216
+ if (index < buttons?.length - 1) {
217
+ renderArray.push(<CapDivider className={templatePreview ? "whatsapp-divider" : "whatsapp-list-view-divider"} />);
218
+ }
219
+ });
220
+ }
221
+ return renderArray;
222
+ };
223
+
224
+
191
225
  export const getWhatsappAutoFill = (template) => {
192
226
  const {category}= get(
193
227
  template,