@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
36 lines • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowWhatsappButtonListSection = void 0;
const tslib_1 = require("tslib");
const content_fields_base_1 = require("../content-fields-base");
const flow_whatsapp_button_list_row_1 = require("./flow-whatsapp-button-list-row");
class FlowWhatsappButtonListSection extends content_fields_base_1.ContentFieldsBase {
constructor() {
super(...arguments);
this.title = '';
this.rows = [];
}
static fromHubtypeCMS(component, locale, cmsApi) {
const newButton = new FlowWhatsappButtonListSection(component.id);
newButton.title = this.getTextByLocale(locale, component.title);
newButton.rows = component.rows.map(row => flow_whatsapp_button_list_row_1.FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi));
return newButton;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
trackFlow(_request) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
// Not apply for this content, because it is a child of the FlowWhatsappButtonList content
});
}
toBotonic(sectionIndex) {
const rows = this.rows.reduce((acc, row, rowIndex) => {
const botonicRow = row.toBotonic(rowIndex, sectionIndex);
if (botonicRow)
acc.push(botonicRow);
return acc;
}, []);
return { title: this.title, rows };
}
}
exports.FlowWhatsappButtonListSection = FlowWhatsappButtonListSection;
//# sourceMappingURL=flow-whatsapp-button-list-section.js.map