import React from 'react';
import { VERSION } from './env';
import { Landing } from './Landing';
// TODO: 后续考虑用 shadow DOM
export class AlexRoot extends HTMLElement {
}
customElements.get('codeblitz-root') ? null : customElements.define('codeblitz-root', AlexRoot);
export const Root = (props) => {
    var _a;
    const themeType = props.theme;
    const LandingComponent = props.Landing || Landing;
    // TODO: 可以获取挂载元素的 Rect 来设置宽高
    return (React.createElement("codeblitz-root", { class: `codeblitz-root ${themeType ? `codeblitz-${themeType}` : ''} ${(_a = props.className) !== null && _a !== void 0 ? _a : ''}`, style: Object.assign({ width: '100%', height: '100%' }, props.style), "data-meta-version": VERSION },
        (props.status === 'loading' || props.status === 'error') && React.createElement(LandingComponent, Object.assign({}, props)),
        props.children));
};
//# sourceMappingURL=Root.js.map