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

export default function StartJobPage() {

    // const userApi = new usersService();
    // const activeJobList  = userApi.getMyJobList();
    const [MyJobList, setMyJobList] = useState([]);
    const api = new usersService();

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

    // debugger;
    return (
        <>
            <StartJob MyJobList={MyJobList} />
        </>
    );
}
