text: import { useState, useEffect } from 'react';
  import axios from 'axios';
  
  const useResources = resource => {
    const [resources, setResources] = useState([]);
  
    useEffect(() => {
      const loadResources = async () => {
        const response = await axios.get(
          `https://jsonplaceholder.typicode.com/${resource}`
        );
  
        setResources(response.data);
      };
  
      loadResources();
    }, [resource]);
  
    return resources;
  };
  
  export default useResources;
  