File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -30,23 +30,10 @@ const MapPopup: React.FC<MapPopupProps> = ({
30
30
fcMetadata,
31
31
} ) => {
32
32
const areas = Array . from ( { length : 6 } , ( _ , index ) => ( {
33
- area : fcMetadata [ `Area_km2_${ index + 1 } ` ] ,
34
33
color : colors [ index ] ,
35
- percent : fcMetadata [ `Percent_${ index + 1 } ` ] ,
36
- } ) )
37
- . filter ( ( { percent } ) => percent > 0 )
38
- . map ( ( areaInfo ) => {
39
- const formattedArea =
40
- areaInfo . area > 1000
41
- ? `${ ( areaInfo . area / 1000 ) . toFixed ( 1 ) } Mil Km²`
42
- : `${ areaInfo . area . toFixed ( 0 ) } Km²` ;
43
-
44
- return {
45
- color : areaInfo . color ,
46
- area : formattedArea ,
47
- percent : areaInfo . percent . toFixed ( 0 ) ,
48
- } ;
49
- } ) ;
34
+ area : fcMetadata [ `Area_info_${ index + 1 } ` ] ,
35
+ percent : fcMetadata [ `Percent_${ index + 1 } ` ] ?. toFixed ( 2 ) ,
36
+ } ) ) . filter ( ( areaInfo ) => areaInfo . area ) ;
50
37
51
38
return (
52
39
< PopupContent >
You can’t perform that action at this time.
0 commit comments