import React, { useState, useEffect } from "react";
import Resources from "../components/Resources";
import usersService from "../services/UsersService";
export default function ResourcePage() {
  const [MyResourceData, setMyResourceData] = useState([]);
  const api = new usersService();

  const getMyResourceData = async () => {
    try {
      const res = await api.getResourceList();
      setMyResourceData(res.data);
    } catch (error) {
      throw new Error("Error getting mode");
    }
  };
  useEffect(() => {
    getMyResourceData();
  }, []);

  return <Resources MyResourceData={MyResourceData} />;
}