import { jsxs as _jsxs, jsx as _jsx } 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 { PanelDivider, PanelListItem } from '@finos/legend-art';
import { LoadFromResultSetAsValueTuplesTempTableStrategy, LoadFromSubQueryTempTableStrategy, LoadFromTempFileTempTableStrategy, } from '@finos/legend-graph';
import { observer } from 'mobx-react-lite';
import { ExecutionNodeViewer, generateExecutionNodeLabel, } from './ExecutionPlanViewer.js';
import {} from '../../stores/execution-plan/ExecutionPlanState.js';
export var TEMP_TABLE_STRATEGY_TYPES;
(function (TEMP_TABLE_STRATEGY_TYPES) {
    TEMP_TABLE_STRATEGY_TYPES["RESULT_SET"] = "resultSet";
    TEMP_TABLE_STRATEGY_TYPES["TEMP_FILE"] = "tempFile";
    TEMP_TABLE_STRATEGY_TYPES["SUB_QUERY"] = "subQuery";
})(TEMP_TABLE_STRATEGY_TYPES || (TEMP_TABLE_STRATEGY_TYPES = {}));
export const TempTableStrategyViewer = observer((props) => {
    const { tempTableStrategy, executionPlanState } = props;
    let _type = '';
    if (tempTableStrategy instanceof LoadFromResultSetAsValueTuplesTempTableStrategy) {
        _type = TEMP_TABLE_STRATEGY_TYPES.RESULT_SET;
    }
    else if (tempTableStrategy instanceof LoadFromTempFileTempTableStrategy) {
        _type = TEMP_TABLE_STRATEGY_TYPES.TEMP_FILE;
    }
    if (tempTableStrategy instanceof LoadFromSubQueryTempTableStrategy) {
        _type = TEMP_TABLE_STRATEGY_TYPES.SUB_QUERY;
    }
    return (_jsxs("div", { className: "query-builder__temp-table-strategy__container", children: [_type && (_jsxs(PanelListItem, { className: "query-builder__temp-table-strategy__container__item", children: ["Type: ", _type] })), _jsx(PanelListItem, { className: "query-builder__temp-table-strategy__container__header", children: `Create Temp Table (${generateExecutionNodeLabel(tempTableStrategy.createTempTableNode)})` }), _jsx(ExecutionNodeViewer, { executionNode: tempTableStrategy.createTempTableNode, executionPlanState: executionPlanState, viewJson: false }), _jsx(PanelDivider, {}), _jsx(PanelListItem, { className: "query-builder__temp-table-strategy__container__header", children: `Load Temp Table (${generateExecutionNodeLabel(tempTableStrategy.loadTempTableNode)})` }), _jsx(ExecutionNodeViewer, { executionNode: tempTableStrategy.loadTempTableNode, executionPlanState: executionPlanState, viewJson: false }), _jsx(PanelDivider, {}), _jsx(PanelListItem, { className: "query-builder__temp-table-strategy__container__header", children: `Drop Temp Table (${generateExecutionNodeLabel(tempTableStrategy.dropTempTableNode)})` }), _jsx(ExecutionNodeViewer, { executionNode: tempTableStrategy.dropTempTableNode, executionPlanState: executionPlanState, viewJson: false }), _jsx(PanelDivider, {})] }));
});
//# sourceMappingURL=TempTableStrategyViewer.js.map