import labels from '../labels'; import formState from '../state'; declare var acfw_edit_coupon: any; /** * Get the html markup for the customer details section of the modal. * * @since 4.5.3 * * @returns {string} Section html markup. */ export default function customerDetailsSectionMarkup() { return `
2

${getSectionTitle(formState.get('option'))}

${getSectionContent(formState.get('option'))}
`; } /** * Get the title for the "details" section of the modal. * * @since 4.6.6 * * @param {string} option The option to pass to the section renderer. * @returns {string} Section HTML markup. */ function getSectionTitle(option: string) { switch (option) { case 'email': return labels.email.customer_details; case 'pushengage': return labels.pushengage.customer_details; } return ''; } /** * Get the HTML markup for the "details" section of the modal. * * @since 4.6.6 * * @param {string} option The option to pass to the section renderer. * @returns {string} Section HTML markup. */ function getSectionContent(option: string) { switch (option) { case 'email': return `
`; case 'pushengage': return `
`; } return ''; } /** * Get segment options markup. * * @since 4.6.6 */ function segment_options(): string { const { segments }: { segments: { segment_id: number; segment_name: string }[] } = acfw_edit_coupon.send_coupon.pushengage; let markup: string = ''; for (const segment of segments) { markup += ``; } markup += ``; return markup; }