Skip to content

Commit d3e5a16

Browse files
committed
feat: added type for consolidated score element
1 parent 22af671 commit d3e5a16

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/components/ProjectCompartor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import CommonError from "./CommonError";
88
import Collapsible from "./Collapsable";
99
import Loading from "./Loading";
1010
import { ComparatorDiff } from "./ComparatorDiff";
11-
import { ScoreElement } from "../types";
11+
import { ScoreElement, ConsolidatedScoreElement } from "../types";
1212

1313
import "../styles/ProjectDetails.css";
1414

@@ -141,7 +141,7 @@ function ProjectComparator() {
141141
</p>
142142
<hr />
143143
{Array.isArray(state) &&
144-
state.map((element: any) => (
144+
state.map((element:ConsolidatedScoreElement) => (
145145
<>
146146
<div key={element.name} className="card__wrapper">
147147
<div data-testid={element.name} className="heading__wrapper">

src/types/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ export interface ScoreElement {
88
url: string;
99
};
1010
}
11+
12+
export interface ConsolidatedScoreElement {
13+
areEqual: boolean,
14+
name: string,
15+
details: string[],
16+
reason: string,
17+
score: number,
18+
short: string,
19+
url: string,
20+
prevDetails: string[],
21+
prevReason: string,
22+
prevScore: number,
23+
}

0 commit comments

Comments
 (0)