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 commonHeadData =()=>{
        console.log("COMMON HEAD DATA ----------------=====---------------------");
    return 0;
    }
    const getMyActiveJobList = async () => {
        try {
            const res = await api.getMyActiveTaskList();
            setMyActiveJobList(res.data);
        } catch (error) {
            console.log("Error getting mode");
        }
    };
    useEffect(() => {
        getMyActiveJobList();
    }, []);

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