diff --git a/ui/components/digital-right-indicator-list.tsx b/ui/components/digital-right-indicator-list.tsx index 2dd447db8..e97ea175c 100644 --- a/ui/components/digital-right-indicator-list.tsx +++ b/ui/components/digital-right-indicator-list.tsx @@ -1,7 +1,6 @@ import { DigitalRightsPillar} from "database/ancillary"; -import { Score } from "database/processed/db"; +import { DigitalRightScore } from "database/processed/db"; import { roundNumber } from "lib"; -import { ReactChild, ReactFragment, ReactPortal } from "react"; import { FaLink, FaSourcetree } from "react-icons/fa"; import useSWR from "swr"; @@ -103,7 +102,7 @@ const MissingIndicators = ({ showSources, isShowingRawScores, }: { - filledIndicators: Score[]; + filledIndicators: DigitalRightScore[]; country: string; pillar: DigitalRightsPillar; showSources: boolean; @@ -120,12 +119,12 @@ const MissingIndicators = ({ const missingIndicators = allIndicators .filter( - (indicator: Score) => + (indicator: DigitalRightScore) => !filledIndicators.find( - ({ Indicator }: Score) => Indicator === indicator["Indicator"] + ({ Indicator }: DigitalRightScore) => Indicator === indicator["Indicator"] ) ) - .map((indicator: Score) => ({ + .map((indicator: DigitalRightScore) => ({ ...indicator, new_rank_score: null, data_col: null, @@ -151,18 +150,18 @@ const Indicator = ({ showSources, isShowingRawScores, }: { - indicator: any & { sources: any[] }; + indicator: DigitalRightScore & { sources: DigitalRightScore[] }; showSources: boolean; isShowingRawScores: boolean; }) => { const hasNoData = indicator.data_col === null; // we want to get the source name from the list of sources, // but if empty, we need to fall back to the indicator's "Data Source" - const sources = (indicator.sources || [indicator]).map((ind: { [x: string]: any; }) => ({ - link: ind["Source URL"], - source: ind["Source Name"], - year: ind["Year"] - })).filter((ind: { source: any; link: any; }) => ind.source && ind.link); + const sources = (indicator.sources || [indicator]).map(indicator => ({ + link: indicator["Source URL"], + source: indicator["Source Name"], + year: indicator["Year"] + })).filter(indicator => indicator.source && indicator.link) const value = +indicator.new_rank_score; const disp_val = value == 0 ? 0 : roundNumber(value, 2); return ( @@ -197,7 +196,7 @@ const Indicator = ({ )} {showSources && sources.length > 0 && (