@@ -3,10 +3,9 @@ import { useCallback, useMemo, useState } from "react";
33import styled from "styled-components" ;
44import { ExternalApiUsage } from "../../data-extensions-editor/external-api-usage" ;
55import { ModeledMethod } from "../../data-extensions-editor/modeled-method" ;
6- import { pluralize } from "../../common/word" ;
76import { ModeledMethodDataGrid } from "./ModeledMethodDataGrid" ;
87import { calculateModeledPercentage } from "../../data-extensions-editor/shared/modeled-percentage" ;
9- import { decimalFormatter , percentFormatter } from "./formatters" ;
8+ import { percentFormatter } from "./formatters" ;
109import { Codicon } from "../common" ;
1110import { Mode } from "../../data-extensions-editor/shared/mode" ;
1211import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" ;
@@ -60,16 +59,6 @@ const TitleButton = styled(VSCodeButton)`
6059 }
6160` ;
6261
63- const StatusContainer = styled . div `
64- display: flex;
65- gap: 1em;
66- align-items: center;
67-
68- margin-top: 0.5em;
69- margin-bottom: 0.5em;
70- margin-left: 1em;
71- ` ;
72-
7362type Props = {
7463 title : string ;
7564 externalApiUsages : ExternalApiUsage [ ] ;
@@ -100,10 +89,6 @@ export const LibraryRow = ({
10089 setExpanded ( ( oldIsExpanded ) => ! oldIsExpanded ) ;
10190 } , [ ] ) ;
10291
103- const usagesCount = useMemo ( ( ) => {
104- return externalApiUsages . reduce ( ( acc , curr ) => acc + curr . usages . length , 0 ) ;
105- } , [ externalApiUsages ] ) ;
106-
10792 const handleModelWithAI = useCallback ( async ( e : React . MouseEvent ) => {
10893 e . stopPropagation ( ) ;
10994 e . preventDefault ( ) ;
@@ -139,35 +124,12 @@ export const LibraryRow = ({
139124 </ TitleButton >
140125 </ TitleContainer >
141126 { isExpanded && (
142- < >
143- < StatusContainer >
144- < div >
145- { pluralize (
146- externalApiUsages . length ,
147- "method" ,
148- "methods" ,
149- decimalFormatter . format . bind ( decimalFormatter ) ,
150- ) }
151- </ div >
152- < div >
153- { pluralize (
154- usagesCount ,
155- "usage" ,
156- "usages" ,
157- decimalFormatter . format . bind ( decimalFormatter ) ,
158- ) }
159- </ div >
160- < div >
161- { percentFormatter . format ( modeledPercentage / 100 ) } modeled
162- </ div >
163- </ StatusContainer >
164- < ModeledMethodDataGrid
165- externalApiUsages = { externalApiUsages }
166- modeledMethods = { modeledMethods }
167- mode = { mode }
168- onChange = { onChange }
169- />
170- </ >
127+ < ModeledMethodDataGrid
128+ externalApiUsages = { externalApiUsages }
129+ modeledMethods = { modeledMethods }
130+ mode = { mode }
131+ onChange = { onChange }
132+ />
171133 ) }
172134 </ LibraryContainer >
173135 ) ;
0 commit comments