UNPKG

@kadconsulting/dry

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