Starting physical address lookups

This commit is contained in:
Sean Edmunds
2025-01-28 16:27:18 -06:00
parent a372a7d8e8
commit 7f1dd022a0
5 changed files with 51 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import { appTheme } from 'contexts';
import { useAtom } from 'jotai';
import { useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import { useQueryAPI, useWeatherAPI } from './useAPI';
import { useCensusAPI, useQueryAPI, useWeatherAPI } from './useAPI';
export function useCommonHooks() {
const isMobile = window.matchMedia('(max-width: 600px)').matches;
@@ -161,6 +161,18 @@ export function useCommonHooks() {
}
}, [wolClients, wolClientsIsFetched]);
const { data: locationData } = useCensusAPI({
address: personalData?.[0]?.physicalAddress,
});
const [location, setLocation] = useState<any>([]);
useEffect(() => {
if (locationData) {
setLocation(locationData);
}
}, [locationData]);
return {
isMobile,
theme,
@@ -222,6 +234,7 @@ export function useCommonHooks() {
wolClientsIsFetched,
wolClientsIsFetching,
wolClientsIsLoading,
location,
notify,
};
}