@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
25 lines • 1.04 kB
JavaScript
import { ContentFieldsBase } from '../content-fields-base';
import { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row';
export class FlowWhatsappButtonListSection extends 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 => FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi));
return newButton;
}
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 };
}
}
//# sourceMappingURL=flow-whatsapp-button-list-section.js.map