{"size": 851, "ext": "js", "max_stars_repo_path": "src/mjmlEngine/mjmlBody.js", "max_stars_repo_name": "anduong96/Email-Creator", "max_stars_repo_stars_event_min_datetime": "2018-06-17T03:30:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-10T03:30:04.000Z", "max_issues_repo_path": "src/mjmlEngine/mjmlBody.js", "max_issues_repo_name": "anduong96/Email-Creator", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/mjmlEngine/mjmlBody.js", "max_forks_repo_name": "anduong96/Email-Creator", "max_forks_repo_forks_event_min_datetime": "2018-07-04T15:03:57.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-13T09:34:59.000Z"}
{"max_stars_count": 10, "max_issues_count": null, "max_forks_count": 4, "avg_line_length": 26.59375, "max_line_length": 73, "alphanum_fraction": 0.4077555817}
import { mjmlTemplate, MJML } from './mjmlBasics'

export const mjmlBody = ({ contents, bodyAttributes }) =>  mjmlTemplate({
    tag: MJML.BODY,
    attributes: bodyAttributes,
    children: [
        buildWrapperLayers({ contents })
    ]
})

const buildWrapperLayers = ({ contents }) => mjmlTemplate({
    tag: MJML.CONTAINER,
    children: [
        mjmlTemplate({
            tag: MJML.WRAPPER,
            children: contents.map(
                (child) => (
                    mjmlTemplate({
                        tag: MJML.SECTION,
                        children: [
                            mjmlTemplate({
                                tag: MJML.COLUMN,
                                children: child
                            })
                        ]
                    })
                )
            )
        })
    ]
})
