@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
25 lines • 1.33 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { WhatsappButtonList } from '@botonic/react';
import { ContentFieldsBase } from '../content-fields-base';
import { FlowWhatsappButtonListSection } from './flow-whatsapp-button-list-section';
export class FlowWhatsappButtonList extends ContentFieldsBase {
constructor() {
super(...arguments);
this.code = '';
this.text = '';
this.listButtonText = '';
this.sections = [];
}
static fromHubtypeCMS(component, locale, cmsApi) {
const newWhatsappButtonList = new FlowWhatsappButtonList(component.id);
newWhatsappButtonList.code = component.code;
newWhatsappButtonList.text = this.getTextByLocale(locale, component.content.text);
newWhatsappButtonList.listButtonText = this.getTextByLocale(locale, component.content.button_text);
newWhatsappButtonList.sections = component.content.sections.map(section => FlowWhatsappButtonListSection.fromHubtypeCMS(section, locale, cmsApi));
return newWhatsappButtonList;
}
toBotonic(id) {
return (_jsx(WhatsappButtonList, { body: this.text, button: this.listButtonText, sections: this.sections.map((section, sectionIndex) => section.toBotonic(sectionIndex)) }, id));
}
}
//# sourceMappingURL=flow-whatsapp-button-list.js.map