@@ -2,7 +2,8 @@ import * as React from 'react';
2
2
import { getBEMElement , prefixClaName } from 'mo/common/className' ;
3
3
import TreeView from 'mo/components/tree' ;
4
4
import { localize } from 'mo/i18n/localize' ;
5
- import { Scrollable } from 'mo/components' ;
5
+ import { Icon , Scrollable } from 'mo/components' ;
6
+ import { IProblems , MarkerSeverity } from 'mo/model' ;
6
7
7
8
const defaultClassName = prefixClaName ( 'problems' ) ;
8
9
const treeClassName = getBEMElement ( defaultClassName , 'treeview' ) ;
@@ -11,9 +12,9 @@ const treeNodeBadgeClassName = getBEMElement(treeNodeClassName, 'badge');
11
12
const treeLeafClassName = getBEMElement ( treeClassName , 'treeLeaf' ) ;
12
13
const treeLeafSubInfoClassName = getBEMElement ( treeLeafClassName , 'subInfo' ) ;
13
14
14
- function ProblemsPaneView ( props : any ) {
15
+ function ProblemsPaneView ( props : IProblems ) {
15
16
const { data } = props ;
16
- if ( ! data ?. length )
17
+ if ( ! data ?. length ) {
17
18
return (
18
19
< div style = { { margin : '0 18px' , userSelect : 'none' } } >
19
20
{ localize (
@@ -22,6 +23,24 @@ function ProblemsPaneView(props: any) {
22
23
) }
23
24
</ div >
24
25
) ;
26
+ }
27
+
28
+ const getIcon = ( status : number ) => {
29
+ switch ( status ) {
30
+ case MarkerSeverity . Error : {
31
+ return < Icon type = "error" /> ;
32
+ }
33
+ case MarkerSeverity . Warning : {
34
+ return < Icon type = "warning" /> ;
35
+ }
36
+ case MarkerSeverity . Info : {
37
+ return < Icon type = "info" /> ;
38
+ }
39
+ default : {
40
+ return '' ;
41
+ }
42
+ }
43
+ } ;
25
44
26
45
return (
27
46
< Scrollable >
@@ -39,7 +58,8 @@ function ProblemsPaneView(props: any) {
39
58
</ span >
40
59
) : (
41
60
< span className = { treeLeafClassName } >
42
- { value . message }
61
+ { getIcon ( value . status ) }
62
+ < span > { value . message } </ span >
43
63
< span className = { treeLeafSubInfoClassName } >
44
64
{ value . code }
45
65
</ span >
0 commit comments