File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export enum ResultFormat {
2+ Alerts = "Alerts" ,
3+ RawResults = "Raw results" ,
4+ }
Original file line number Diff line number Diff line change 1+ import * as React from "react" ;
2+ import { useCallback } from "react" ;
3+ import { styled } from "styled-components" ;
4+ import { VSCodeDropdown , VSCodeOption } from "@vscode/webview-ui-toolkit/react" ;
5+ import { Codicon } from "../common" ;
6+ import { ResultFormat } from "../../variant-analysis/shared/variant-analysis-result-format" ;
7+
8+ const Dropdown = styled ( VSCodeDropdown ) `
9+ width: 100%;
10+ ` ;
11+
12+ type Props = {
13+ value : ResultFormat ;
14+ onChange : ( value : ResultFormat ) => void ;
15+
16+ className ?: string ;
17+ } ;
18+
19+ export const RepositoriesResultFormat = ( {
20+ value,
21+ onChange,
22+ className,
23+ } : Props ) => {
24+ const handleInput = useCallback (
25+ ( e : InputEvent ) => {
26+ const target = e . target as HTMLSelectElement ;
27+
28+ onChange ( target . value as ResultFormat ) ;
29+ } ,
30+ [ onChange ] ,
31+ ) ;
32+
33+ return (
34+ < Dropdown value = { value } onInput = { handleInput } className = { className } >
35+ < Codicon name = "table" label = "Result format..." slot = "indicator" />
36+ < VSCodeOption value = { ResultFormat . Alerts } > Alerts</ VSCodeOption >
37+ < VSCodeOption value = { ResultFormat . RawResults } > Raw results</ VSCodeOption >
38+ </ Dropdown >
39+ ) ;
40+ } ;
You can’t perform that action at this time.
0 commit comments