UNPKG

@kadconsulting/dry

Version:
25 lines 893 B
// @ts-nocheck import { useState, useEffect } from 'react'; import { fetchLocationsPageData, } from '../api/fetchData'; export const useLocationsPageData = () => { const [locationsSections, setLocationsSections] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { const fetchLocationsData = async () => { setLoading(true); try { const response = await fetchLocationsPageData(); setLocationsSections(response?.data?.attributes || null); } catch (error) { console.error('Failed to fetch locations page data', error); } finally { setLoading(false); } }; fetchLocationsData(); }, []); return { locationsSections, loading }; }; //# sourceMappingURL=useLocationsPageData.js.map