UNPKG

@handie/squirtle

Version:

Widgets for Handie-React

29 lines (28 loc) 1.04 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { isString, isComponentCtor, } from 'handie-react'; import { DialogViewStructuralWidget } from 'handie-react/dist/widgets/class'; import style from './style.scss'; export default class DialogViewWidget extends DialogViewStructuralWidget { render() { const { $$child } = this.config; let resolvedChildren; if ($$child === undefined) { resolvedChildren = this.props.children; } else if (isComponentCtor($$child)) { const DialogContent = $$child; resolvedChildren = _jsx(DialogContent, {}, void 0); } else if (isString($$child)) { // TODO: use `ViewRenderer` } return this.renderDialog({ className: this.getStyleClassName('DialogViewWidget'), actionBarClassName: this.getStyleClassName('DialogViewWidget-actionBar'), children: resolvedChildren, }); } created() { this.setStyleClassNames(style); } }