Skip to content

Commit

Permalink
feat: added type for consolidated score element
Browse files Browse the repository at this point in the history
  • Loading branch information
KoolTheba committed Oct 28, 2023
1 parent 22af671 commit d3e5a16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/ProjectCompartor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CommonError from "./CommonError";
import Collapsible from "./Collapsable";
import Loading from "./Loading";
import { ComparatorDiff } from "./ComparatorDiff";
import { ScoreElement } from "../types";
import { ScoreElement, ConsolidatedScoreElement } from "../types";

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

Expand Down Expand Up @@ -141,7 +141,7 @@ function ProjectComparator() {
</p>
<hr />
{Array.isArray(state) &&
state.map((element: any) => (
state.map((element:ConsolidatedScoreElement) => (
<>
<div key={element.name} className="card__wrapper">
<div data-testid={element.name} className="heading__wrapper">
Expand Down
13 changes: 13 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ export interface ScoreElement {
url: string;
};
}

export interface ConsolidatedScoreElement {
areEqual: boolean,
name: string,
details: string[],
reason: string,
score: number,
short: string,
url: string,
prevDetails: string[],
prevReason: string,
prevScore: number,
}

0 comments on commit d3e5a16

Please sign in to comment.