/**
* 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 {
Dialog,
ResizablePanelGroup,
ResizablePanel,
ResizablePanelSplitter,
ResizablePanelSplitterLine,
PanelLoadingIndicator,
PanelContent,
Modal,
ModalHeader,
ModalBody,
ModalFooter,
ModalTitle,
ModalHeaderActions,
TimesIcon,
ModalFooterButton,
BlankPanelContent,
PanelHeader,
Panel,
InputWithInlineValidation,
clsx,
} from '@finos/legend-art';
import { useEffect } from 'react';
import { isBoolean, noop, type PlainObject } from '@finos/legend-shared';
import {
useApplicationStore,
useConditionedApplicationNavigationContext,
} from '@finos/legend-application';
import { flowResult } from 'mobx';
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
import { CodeEditor } from '@finos/legend-lego/code-editor';
import type { DatabaseBuilderWizardState } from '../../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js';
import { DatabaseSchemaExplorer } from './DatabaseSchemaExplorer.js';
import {
DataGrid,
type DataGridCellRendererParams,
type DataGridColumnDefinition,
} from '@finos/legend-lego/data-grid';
import type { TDSExecutionResult } from '@finos/legend-graph';
type IQueryRendererParamsWithGridType = DataGridCellRendererParams & {
tdsExecutionResult: TDSExecutionResult;
};
const QueryResultCellRenderer = observer(
(params: IQueryRendererParamsWithGridType) => {
const cellValue = params.value as string | null | number | undefined;
return (