import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { observer } from 'mobx-react-lite';
import { QueryBuilderTextEditorMode } from '../stores/QueryBuilderTextEditorState.js';
import { BlankPanelContent, ResizablePanelGroup, ResizablePanel, ResizablePanelSplitter, Panel, PanelContent, PanelHeader, } from '@finos/legend-art';
import { QueryBuilderSidebar } from './QueryBuilderSideBar.js';
import { QueryBuilderParametersPanel } from './QueryBuilderParametersPanel.js';
import { QueryChat } from './QueryChat.js';
const QueryBuilderUnsupportedQueryViewer = observer((props) => {
    const { queryBuilderState } = props;
    const queryUnsupportedState = queryBuilderState.unsupportedQueryState;
    const lambdaError = queryUnsupportedState.lambdaError;
    const errorMessage = lambdaError?.message
        ? ` due to: ${lambdaError.message}`
        : '';
    const openLambdaModal = () => queryBuilderState.textEditorState.openModal(QueryBuilderTextEditorMode.TEXT);
    return (_jsxs(Panel, { children: [_jsx(PanelHeader, { title: "content" }), _jsx(PanelContent, { children: _jsx(BlankPanelContent, { children: _jsxs("div", { className: "query-builder__unsupported-view__main", children: [_jsx("div", { className: "query-builder__unsupported-view__summary", children: `Can't display query in form mode${errorMessage}` }), _jsx("button", { className: "btn--dark query-builder__unsupported-view__to-text-mode__btn", onClick: openLambdaModal, children: "Edit in text mode" })] }) }) })] }));
});
export const QueryBuilderUnsupportedQueryEditor = observer((props) => {
    const { queryBuilderState } = props;
    return (_jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { size: 450, children: _jsx(QueryBuilderSidebar, { queryBuilderState: queryBuilderState, children: _jsx(QueryBuilderParametersPanel, { queryBuilderState: queryBuilderState }) }) }), _jsx(ResizablePanelSplitter, {}), _jsx(ResizablePanel, { children: _jsx(QueryBuilderUnsupportedQueryViewer, { queryBuilderState: queryBuilderState }) }), queryBuilderState.isQueryChatOpened && _jsx(ResizablePanelSplitter, {}), queryBuilderState.isQueryChatOpened && (_jsx(ResizablePanel, { size: 450, children: _jsx(QueryChat, { queryBuilderState: queryBuilderState }) }))] }));
});
//# sourceMappingURL=QueryBuilderUnsupportedQueryEditor.js.map