-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move adm0data request to client
- Loading branch information
1 parent
0844777
commit 164e0f8
Showing
3 changed files
with
28 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
'use client'; | ||
|
||
import ComparisonAccordionSkeleton from '@/components/ComparisonPortal/ComparisonAccordionSkeleton'; | ||
import ComparisonPortal from '@/components/ComparisonPortal/CountryComparison'; | ||
import container from '@/container'; | ||
import { GlobalDataRepository } from '@/domain/repositories/GlobalDataRepository'; | ||
import SelectionSkeleton from '@/components/ComparisonPortal/CountrySelectSkeleton'; | ||
import { useFcsData, useMapDataForCountries } from '@/domain/hooks/globalHooks'; | ||
|
||
export default async function Page() { | ||
const globalRepo = container.resolve<GlobalDataRepository>('GlobalDataRepository'); | ||
const countryMapData = await globalRepo.getMapDataForCountries(); | ||
const globalFcsData = await globalRepo.getFcsData(); | ||
export default function Page() { | ||
const { data: countryMapData, isLoading: isCountryMapDataLoading } = useMapDataForCountries(); | ||
const { data: globalFcsData, isLoading: isFcsDataLoading } = useFcsData(); | ||
return ( | ||
<> | ||
<h1>Comparison Portal</h1> | ||
<ComparisonPortal countryMapData={countryMapData} globalFcsData={globalFcsData} /> | ||
{isCountryMapDataLoading || isFcsDataLoading ? ( | ||
<> | ||
<SelectionSkeleton /> | ||
<ComparisonAccordionSkeleton nItems={5} /> | ||
</> | ||
) : ( | ||
<ComparisonPortal countryMapData={countryMapData!} globalFcsData={globalFcsData!} /> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters