diff --git a/src/components/Map/FcsAccordion.tsx b/src/components/Map/FcsAccordion.tsx deleted file mode 100644 index b7a32e8a..00000000 --- a/src/components/Map/FcsAccordion.tsx +++ /dev/null @@ -1,173 +0,0 @@ -import { Spacer } from '@nextui-org/react'; - -import FcsAccordionProps from '@/domain/props/FcsAccordionProps'; -import { FcsAccordionOperations } from '@/operations/map/FcsAccordionOperations'; -import { cardsWrapperClass } from '@/utils/primitives'; - -import { ReactComponent as FoodConsumption } from '../../../public/Images/FoodConsumption.svg'; -import { ReactComponent as Import } from '../../../public/Images/Import.svg'; -import { ReactComponent as Population } from '../../../public/Images/Population.svg'; -import AccordionContainer from '../Accordions/AccordionContainer'; -import CustomCard from '../Cards/Card'; -import { LineChart } from '../Charts/LineChart'; -import CustomInfoCircle from '../CustomInfoCircle/CustomInfoCircle'; - -export default function FcsAccordion({ countryData, loading, countryIso3Data, countryName }: FcsAccordionProps) { - const deltaOneMonth = countryData?.fcsMinus1 ? countryData.fcs - countryData.fcsMinus1 : null; - const deltaThreeMonth = countryData?.fcsMinus3 ? countryData.fcs - countryData.fcsMinus3 : null; - const fcsChartData = FcsAccordionOperations.getFcsChartData(countryData); - const rcsiChartData = FcsAccordionOperations.getRcsiChartData(countryData); - const currencyExchangeChartData = FcsAccordionOperations.getCurrencyExchangeChartData(countryIso3Data); - const balanceOfTradeChartData = FcsAccordionOperations.getBalanceOfTradeChartData(countryIso3Data); - const headlineAndFoodInflationChartData = - FcsAccordionOperations.getHeadlineAndFoodInflationChartData(countryIso3Data); - return ( -
- , - popoverInfo: FcsAccordionOperations.getFoodSecutriyPopoverInfo(), - content: ( -
- , - text: countryData?.population ? `${countryData.population.toFixed(2)} M` : 'N/A', - altText: 'Population Icon', - }, - ]} - /> - , - text: countryData?.fcs ? `${countryData.fcs.toFixed(2)} M` : 'N/A', - altText: 'Food Consumption Icon', - }, - { - imageSrc: deltaOneMonth && deltaOneMonth > 0 ? '/Images/ArrowUp.svg' : '/Images/ArrowDown.svg', - text: deltaOneMonth ? `${deltaOneMonth.toFixed(2)} M` : 'N/A', - timeText: '1 Month ago', - altText: 'Icon', - }, - { - imageSrc: - deltaThreeMonth && deltaThreeMonth > 0 ? '/Images/ArrowUp.svg' : '/Images/ArrowDown.svg', - text: deltaThreeMonth ? `${deltaThreeMonth.toFixed(2)} M` : 'N/A', - timeText: '3 Month ago', - altText: 'Other Icon', - }, - ]} - /> -
- ), - }, - { - title: 'Food Security Trends', - infoIcon: , - popoverInfo: FcsAccordionOperations.getFoodSecutriyTrendsPopoverInfo(), - content: ( -
- {fcsChartData ? ( - - ) : ( -

No data about insufficient food consumption

- )} - - {rcsiChartData ? ( - - ) : ( -

No data about crisis or above crisis food-based coping

- )} -
- ), - }, - { - title: 'Macro-economic', - infoIcon: , - popoverInfo: FcsAccordionOperations.getMacroEconomicPopoverInfo(), - content: ( -
- , - text: countryData?.importDependency - ? `${countryData.importDependency.toFixed(1)}% of Cereals` - : 'N/A', - altText: 'Import Dependency Icon', - }, - ]} - /> -
- ), - }, - { - title: 'Currency Exchange', - infoIcon: , - popoverInfo: FcsAccordionOperations.getCurrencyExchangePopoverInfo(), - content: ( -
- {currencyExchangeChartData ? ( - - ) : ( -

No data about currency exchange

- )} -
- ), - }, - { - title: 'Balance of Trade', - infoIcon: , - popoverInfo: FcsAccordionOperations.getBalanceOfTradePopoverInfo(), - content: ( -
- {balanceOfTradeChartData ? ( - - ) : ( -

No data about balance of trade

- )} -
- ), - }, - { - title: 'Headline and food inflation', - infoIcon: , - popoverInfo: FcsAccordionOperations.getHeadlineAndFoodInflationPopoverInfo(), - content: ( -
- {headlineAndFoodInflationChartData ? ( - - ) : ( -

No data about headline and food inflation

- )} -
- ), - }, - ]} - /> -
- ); -} diff --git a/src/components/Map/FcsRegionTooltip.tsx b/src/components/Map/FcsMap/FcsRegionTooltip.tsx similarity index 97% rename from src/components/Map/FcsRegionTooltip.tsx rename to src/components/Map/FcsMap/FcsRegionTooltip.tsx index 3ad1ad99..67017b26 100644 --- a/src/components/Map/FcsRegionTooltip.tsx +++ b/src/components/Map/FcsMap/FcsRegionTooltip.tsx @@ -3,7 +3,7 @@ import { Feature, GeoJsonProperties, Geometry } from 'geojson'; import { FcsRegionTooltipOperations } from '@/operations/map/FcsRegionTooltipOperations'; import { formatToMillion } from '@/utils/formatting'; -import { LineChart } from '../Charts/LineChart'; +import { LineChart } from '../../Charts/LineChart'; interface FcsRegionTooltipProps { feature: Feature; diff --git a/src/operations/map/FcsCountryChoroplethOperations.tsx b/src/operations/map/FcsCountryChoroplethOperations.tsx index fc0c22e0..dbb20ed3 100644 --- a/src/operations/map/FcsCountryChoroplethOperations.tsx +++ b/src/operations/map/FcsCountryChoroplethOperations.tsx @@ -3,7 +3,7 @@ import L from 'leaflet'; import React from 'react'; import { createRoot } from 'react-dom/client'; -import FcsRegionTooltip from '@/components/Map/FcsRegionTooltip'; +import FcsRegionTooltip from '@/components/Map/FcsMap/FcsRegionTooltip'; import { CountryMapData } from '@/domain/entities/country/CountryMapData.ts'; import { MapOperations } from '@/operations/map/MapOperations';