export const useExercices = () => { const [exercices, setExercices] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const fetchExercices = async () => { try { const response = await apiClient.get(EXERCICES.GETALL); setExercices(response.data); setLoading(false); } catch (error) { setError(error); setLoading(false); } }; fetchExercices(); }, []); return { exercices, loading, error }; }