diff --git a/app/src/views/CountryPreparedness/PrivateCountryPreparedness/index.tsx b/app/src/views/CountryPreparedness/PrivateCountryPreparedness/index.tsx index d9b0782fc..be96c8ad4 100644 --- a/app/src/views/CountryPreparedness/PrivateCountryPreparedness/index.tsx +++ b/app/src/views/CountryPreparedness/PrivateCountryPreparedness/index.tsx @@ -96,7 +96,7 @@ function primaryBlueColorShadeselector(_: unknown, i: number) { } // eslint-disable-next-line @typescript-eslint/no-empty-function -const noOp = () => {}; +const noOp = () => { }; // eslint-disable-next-line import/prefer-default-export function PrivateCountryPreparedness() { @@ -453,6 +453,14 @@ function PrivateCountryPreparedness() { [countryId, perId], ); + const topRatedComponentsByArea = assessmentStats?.topRatedComponents?.reduce( + (acc, component) => { + acc[component.area.area_num] = component; + return acc; + }, + {}, + ); + return (
{Object.entries(areaColorShades).map(([areaNum, color]) => { - const area = assessmentStats?.topRatedComponents.find( - (component) => component.area.area_num === Number(areaNum), - ); + const area = topRatedComponentsByArea?.[Number(areaNum)]; if (!area) { return null; @@ -675,7 +681,7 @@ function PrivateCountryPreparedness() { return ( diff --git a/app/src/views/PerAssessmentForm/AreaInput/ComponentInput/index.tsx b/app/src/views/PerAssessmentForm/AreaInput/ComponentInput/index.tsx index 6fe3cbb51..ed3bcc125 100644 --- a/app/src/views/PerAssessmentForm/AreaInput/ComponentInput/index.tsx +++ b/app/src/views/PerAssessmentForm/AreaInput/ComponentInput/index.tsx @@ -283,11 +283,7 @@ function ComponentInput(props: Props) { withoutPadding title={strings.epiConsiderationTitle} description={( -
    -
  • - -
  • -
+ )} >