UNPKG

@kadconsulting/dry

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