-
Notifications
You must be signed in to change notification settings - Fork 67
/
AnalyzerResults.tsx
44 lines (38 loc) 路 1.17 KB
/
AnalyzerResults.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {Space} from 'antd';
import {useRef} from 'react';
import useOnClickOutside from 'hooks/useOnClickOutside';
import {TLintBySpanContent} from 'services/Span.service';
import * as S from './AnalyzerResults.styled';
interface IProps {
lintErrors: TLintBySpanContent[];
onClose(): void;
}
const AnalyzerResults = ({lintErrors, onClose}: IProps) => {
const ref = useRef(null);
useOnClickOutside(ref, onClose);
return (
<S.Container className="nowheel nodrag" ref={ref}>
<S.Connector />
<S.Content>
<Space>
<S.ErrorIcon />
<S.Title level={4}>Analyzer errors</S.Title>
</Space>
<S.Body>
{lintErrors.map(lintError => (
<div key={lintError.ruleName}>
<S.Text strong>{lintError.ruleName}</S.Text>
{lintError.errors.map((error, index) => (
// eslint-disable-next-line react/no-array-index-key
<div key={index}>
<S.Text type="secondary">- {error}</S.Text>
</div>
))}
</div>
))}
</S.Body>
</S.Content>
</S.Container>
);
};
export default AnalyzerResults;