@cuvp1225/tango-mail
Version:
react mail components for tango
20 lines (19 loc) • 769 B
JavaScript
import { __rest } from "tslib";
import { defineComponent } from '@music163/tango-boot';
import React from 'react';
import { Placeholder } from '../placeholder';
function BoxView(_a) {
var { p, m, bg, color, style, children } = _a, props = __rest(_a, ["p", "m", "bg", "color", "style", "children"]);
return (React.createElement("div", Object.assign({}, props, { style: getBoxStyle({ p, m, bg, color, style }) }), children));
}
function getBoxStyle({ p, m, bg, color, style, }) {
return Object.assign({ padding: p, margin: m, backgroundColor: bg, color }, style);
}
export const Box = defineComponent(BoxView, {
name: 'Box',
designerConfig: {
defaultProps: {
children: React.createElement(Placeholder, null),
},
},
});