@@ -4,23 +4,18 @@ import {
44 ShowProgressMessage ,
55 ToDataExtensionsEditorMessage ,
66} from "../../pure/interface-types" ;
7- import {
8- VSCodeButton ,
9- VSCodeDataGrid ,
10- VSCodeDataGridCell ,
11- VSCodeDataGridRow ,
12- } from "@vscode/webview-ui-toolkit/react" ;
7+ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" ;
138import styled from "styled-components" ;
149import { ExternalApiUsage } from "../../data-extensions-editor/external-api-usage" ;
1510import { ModeledMethod } from "../../data-extensions-editor/modeled-method" ;
16- import { MethodRow } from "./MethodRow" ;
1711import { assertNever } from "../../pure/helpers-pure" ;
1812import { vscode } from "../vscode-api" ;
1913import { calculateModeledPercentage } from "./modeled" ;
2014import { LinkIconButton } from "../variant-analysis/LinkIconButton" ;
2115import { basename } from "../common/path" ;
2216import { ViewTitle } from "../common" ;
2317import { DataExtensionEditorViewState } from "../../data-extensions-editor/shared/view-state" ;
18+ import { ModeledMethodDataGrid } from "./ModeledMethodDataGrid" ;
2419
2520const DataExtensionsEditorContainer = styled . div `
2621 margin-top: 1rem;
@@ -42,6 +37,12 @@ const EditorContainer = styled.div`
4237 margin-top: 1rem;
4338` ;
4439
40+ const ButtonsContainer = styled . div `
41+ display: flex;
42+ gap: 0.4em;
43+ margin-bottom: 1rem;
44+ ` ;
45+
4546type ProgressBarProps = {
4647 completion : number ;
4748} ;
@@ -217,57 +218,24 @@ export function DataExtensionsEditor({
217218 </ DetailsContainer >
218219
219220 < EditorContainer >
220- < VSCodeButton onClick = { onApplyClick } > Apply</ VSCodeButton >
221-
222- < VSCodeButton onClick = { onGenerateClick } >
223- Download and generate
224- </ VSCodeButton >
225- { viewState ?. showLlmButton && (
226- < >
227-
228- < VSCodeButton onClick = { onGenerateFromLlmClick } >
229- Generate using LLM
230- </ VSCodeButton >
231- </ >
232- ) }
233- < br />
234- < br />
235- < VSCodeDataGrid >
236- < VSCodeDataGridRow rowType = "header" >
237- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 1 } >
238- Library
239- </ VSCodeDataGridCell >
240- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 2 } >
241- Type
242- </ VSCodeDataGridCell >
243- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 3 } >
244- Method
245- </ VSCodeDataGridCell >
246- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 4 } >
247- Usages
248- </ VSCodeDataGridCell >
249- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 5 } >
250- Model type
251- </ VSCodeDataGridCell >
252- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 6 } >
253- Input
254- </ VSCodeDataGridCell >
255- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 7 } >
256- Output
257- </ VSCodeDataGridCell >
258- < VSCodeDataGridCell cellType = "columnheader" gridColumn = { 8 } >
259- Kind
260- </ VSCodeDataGridCell >
261- </ VSCodeDataGridRow >
262- { externalApiUsages . map ( ( externalApiUsage ) => (
263- < MethodRow
264- key = { externalApiUsage . signature }
265- externalApiUsage = { externalApiUsage }
266- modeledMethod = { modeledMethods [ externalApiUsage . signature ] }
267- onChange = { onChange }
268- />
269- ) ) }
270- </ VSCodeDataGrid >
221+ < ButtonsContainer >
222+ < VSCodeButton onClick = { onApplyClick } > Apply</ VSCodeButton >
223+ < VSCodeButton onClick = { onGenerateClick } >
224+ Download and generate
225+ </ VSCodeButton >
226+ { viewState ?. showLlmButton && (
227+ < >
228+ < VSCodeButton onClick = { onGenerateFromLlmClick } >
229+ Generate using LLM
230+ </ VSCodeButton >
231+ </ >
232+ ) }
233+ </ ButtonsContainer >
234+ < ModeledMethodDataGrid
235+ externalApiUsages = { externalApiUsages }
236+ modeledMethods = { modeledMethods }
237+ onChange = { onChange }
238+ />
271239 </ EditorContainer >
272240 </ >
273241 ) }
0 commit comments