@cuvp1225/tango-mail
Version:
react mail components for tango
20 lines (19 loc) • 820 B
JavaScript
import { __rest } from "tslib";
import { defineComponent } from '@music163/tango-boot';
import React from 'react';
import cx from 'classnames';
function BadgeView(_a) {
var { color = 'blue', showBorder, isPill, className, children } = _a, props = __rest(_a, ["color", "showBorder", "isPill", "className", "children"]);
return (React.createElement("span", Object.assign({ className: cx('text-xs font-medium me-2 px-2.5 py-0.5 rounded', {
[`bg-${color}-100 text-${color}-800`]: color,
[`border border-solid border-${color}-400`]: showBorder,
rounded: !isPill,
'rounded-full': isPill,
}, className) }, props), children));
}
export const Badge = defineComponent(BadgeView, {
name: 'Badge',
designerConfig: {
display: 'inline-block',
},
});