import React, { useContext, useState, useEffect } from "react";
// import BlogItem from "../components/Blogs";
import { useSelector } from "react-redux";
import OffersInterest from "../components/OffersInterest";

import usersService from "../services/UsersService";

export default function OffersInterestPage() {
    const apiCall = new usersService()

    let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)

    let [offerInterestList, setOfferInterestList] = useState({loading: true, data: []})

    useEffect(()=>{
        apiCall.offersInterestList().then(res => {
            setOfferInterestList({loading: false, data: res.data.result_list})
        }).catch(err => {
            setOfferInterestList({loading: false, data: []})
            console.log('Error: ', err)
        })
    },[])

    return (
        <>
            <OffersInterest  commonHeadData={commonHeadBanner.result_list} offerInterestList={offerInterestList} />
        </>
    );
}