@kadconsulting/dry
Version:
KAD Reusable Component Library
25 lines • 848 B
JavaScript
// @ts-nocheck
import { useState, useEffect } from 'react';
import { fetchTermsPageData } from '../api/fetchData';
export const useTermsPageData = () => {
const [termsSections, setTermsSections] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
const fetchTermsData = async () => {
setLoading(true);
try {
const response = await fetchTermsPageData();
setTermsSections(response?.data?.attributes || null);
}
catch (error) {
console.error('Failed to fetch Terms page data', error);
}
finally {
setLoading(false);
}
};
fetchTermsData();
}, []);
return { termsSections, loading };
};
//# sourceMappingURL=useTermsPageData.js.map