kyd-shared-badge 0.1.22 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/IpRiskAnalysisDisplay.tsx +25 -2
- package/src/types.ts +21 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { FiInfo } from 'react-icons/fi';
|
|
4
|
-
import { IpRiskAnalysis, IpRiskAnalysisFinding } from '../types';
|
|
4
|
+
import { IpRiskAnalysis, IpRiskAnalysisFinding, IpRiskSections, IpRiskSection } from '../types';
|
|
5
5
|
|
|
6
6
|
interface IpRiskAnalysisDisplayProps {
|
|
7
7
|
ipRiskAnalysis?: IpRiskAnalysis;
|
|
@@ -19,6 +19,19 @@ const FindingRow = ({ finding }: { finding: IpRiskAnalysisFinding }) => (
|
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
+
const Section = ({ section }: { section: IpRiskSection }) => (
|
|
23
|
+
<div className="mt-6">
|
|
24
|
+
<h4 className="text-lg font-semibold mb-2 text-neutral-900 dark:text-white">{section.title}</h4>
|
|
25
|
+
<div className="space-y-3">
|
|
26
|
+
{section.items.map((item, idx) => (
|
|
27
|
+
<div key={idx} className="">
|
|
28
|
+
<p className="font-medium text-neutral-800 dark:text-neutral-200">{item.label}:</p>
|
|
29
|
+
<p className="text-sm text-neutral-700 dark:text-neutral-300">{item.text}</p>
|
|
30
|
+
</div>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
22
35
|
|
|
23
36
|
const IpRiskAnalysisDisplay = ({ ipRiskAnalysis }: IpRiskAnalysisDisplayProps) => {
|
|
24
37
|
if (!ipRiskAnalysis || !ipRiskAnalysis.checked || !ipRiskAnalysis.findings || ipRiskAnalysis.findings.length === 0) {
|
|
@@ -30,7 +43,17 @@ const IpRiskAnalysisDisplay = ({ ipRiskAnalysis }: IpRiskAnalysisDisplayProps) =
|
|
|
30
43
|
);
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
const { findings = [] } = ipRiskAnalysis;
|
|
46
|
+
const { findings = [], sections } = ipRiskAnalysis as IpRiskAnalysis & { sections?: IpRiskSections };
|
|
47
|
+
|
|
48
|
+
if (sections) {
|
|
49
|
+
return (
|
|
50
|
+
<div className="mt-6 divide-y divide-neutral-200 dark:divide-neutral-700">
|
|
51
|
+
<Section section={sections.general} />
|
|
52
|
+
<Section section={sections.location} />
|
|
53
|
+
<Section section={sections.reputational} />
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
34
57
|
|
|
35
58
|
return (
|
|
36
59
|
<div className="mt-6">
|
package/src/types.ts
CHANGED
|
@@ -92,6 +92,24 @@ export interface IpRiskAnalysisFinding {
|
|
|
92
92
|
implication: string;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export type IpRiskPhase = 'NO_MATCH' | 'POSSIBLE_MATCH' | 'POSITIVE_MATCH';
|
|
96
|
+
|
|
97
|
+
export interface IpRiskSectionItem {
|
|
98
|
+
label: string;
|
|
99
|
+
text: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface IpRiskSection {
|
|
103
|
+
title: string;
|
|
104
|
+
items: IpRiskSectionItem[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface IpRiskSections {
|
|
108
|
+
general: IpRiskSection;
|
|
109
|
+
location: IpRiskSection;
|
|
110
|
+
reputational: IpRiskSection;
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
export interface IpRiskAnalysis {
|
|
96
114
|
checked: boolean;
|
|
97
115
|
findings: IpRiskAnalysisFinding[];
|
|
@@ -103,6 +121,9 @@ export interface IpRiskAnalysis {
|
|
|
103
121
|
impossible_travel_events?: string[];
|
|
104
122
|
anomalous_geo_logins?: string[];
|
|
105
123
|
};
|
|
124
|
+
phase?: IpRiskPhase;
|
|
125
|
+
sections?: IpRiskSections;
|
|
126
|
+
countries?: string[];
|
|
106
127
|
}
|
|
107
128
|
|
|
108
129
|
export interface AssessmentResult {
|