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 { EXECUTION_PLAN_VIEW_MODE, } from '../../stores/execution-plan/ExecutionPlanState.js';
import { SQLExecutionNode, } from '@finos/legend-graph';
import { PanelDivider, Button, PanelContent } from '@finos/legend-art';
import { SQLExecutionNodeViewerHelper } from './SQLExecutionNodeViewer.js';
import { ResultTypeViewer } from './ResultTypeViewer.js';
export const RelationalTDSInstantiationExecutionNodeViewer = observer((props) => {
    const { node, executionPlanState } = props;
    const resultType = node.resultType;
    const applicationStore = executionPlanState.applicationStore;
    return (_jsxs(PanelContent, { darkMode: !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled, children: [node.executionNodes.length > 0 &&
                node.executionNodes[0] !== undefined &&
                node.executionNodes[0] instanceof SQLExecutionNode && (_jsx(SQLExecutionNodeViewerHelper, { query: node.executionNodes[0].sqlQuery, resultColumns: node.executionNodes[0].resultColumns, resultType: node.executionNodes[0].resultType, executionPlanState: executionPlanState })), _jsx(PanelDivider, {}), _jsx(ResultTypeViewer, { resultType: resultType }), _jsx("div", { className: "query-builder__sql__container", children: _jsx(Button, { className: "btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn", onClick: () => executionPlanState.setViewMode(EXECUTION_PLAN_VIEW_MODE.JSON), text: "View JSON" }) }), _jsx(PanelDivider, {})] }));
});
//# sourceMappingURL=RelationalTDSInstantiationExecutionNodeViewer.js.map