import React, { useContext,useState, useEffect } from "react";
import MyTasks from "../components/MyTasks";
import UsersService from "../services/UsersService";
import usersService from "../services/UsersService";

export default function MyTaskPage() {

    const [MyActiveJobList, setMyActiveJobList] = useState([]);
    const api = new usersService();

    const getMyActiveJobList = async () => {
        try {
            const res = await api.getMyActiveJobList();
            setMyActiveJobList(res.data);
        } catch (error) {
            console.log("Error getting mode");
        }
    };
    useEffect(() => {
        getMyActiveJobList();
    }, []);

    //debugger;
    return (
        <>
            <MyTasks ActiveJobList={MyActiveJobList}/>
        </>
    );
}
