"use strict";

import React, { Component } from 'react';
import { View } from 'react-native';
import { BottomTabs } from "./BottomTabs.js";
import { ComponentScreen } from "./ComponentScreen.js";
import { Stack } from "./Stack.js";
import { SideMenuRoot, SideMenuCenter, SideMenuLeft, SideMenuRight } from "./SideMenu.js";
import { jsx as _jsx } from "react/jsx-runtime";
export const LayoutComponent = class extends Component {
  render() {
    switch (this.props.layoutNode.type) {
      case 'BottomTabs':
        return /*#__PURE__*/_jsx(BottomTabs, {
          layoutNode: this.props.layoutNode
        });
      case 'Stack':
        return /*#__PURE__*/_jsx(Stack, {
          layoutNode: this.props.layoutNode
        });
      case 'Component':
        return /*#__PURE__*/_jsx(ComponentScreen, {
          layoutNode: this.props.layoutNode
        });
      case 'SideMenuRoot':
        return /*#__PURE__*/_jsx(SideMenuRoot, {
          layoutNode: this.props.layoutNode
        });
      case 'SideMenuLeft':
        return /*#__PURE__*/_jsx(SideMenuLeft, {
          layoutNode: this.props.layoutNode
        });
      case 'SideMenuCenter':
        return /*#__PURE__*/_jsx(SideMenuCenter, {
          layoutNode: this.props.layoutNode
        });
      case 'SideMenuRight':
        return /*#__PURE__*/_jsx(SideMenuRight, {
          layoutNode: this.props.layoutNode
        });
    }
    return /*#__PURE__*/_jsx(View, {});
  }
  componentDidCatch(error, errorInfo) {
    const err = new Error(`Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`);
    err.cause = error;
    throw err;
  }
};
//# sourceMappingURL=LayoutComponent.js.map