tracjk hx

This commit is contained in:
2023-02-18 12:05:33 -05:00
parent 43cf688068
commit 30e960a3d8
5 changed files with 185 additions and 8 deletions
+33 -4
View File
@@ -6,20 +6,49 @@ import TrackingTable from "./TrackingTable";
import MarketHistorySection from "./MarketHistorySection";
import TrackCategory from "./TrackCategory";
import datas from "../../data/product_data.json";
import usersService from "../../services/UsersService";
export default function Tracking(props) {
console.log("IN TRACKING COMPO", props);
const trending = datas.datas;
console.log("IN TRACKING COMPO TRD", trending);
//debugger;
const api = new usersService();
const [isLoading, setIsLoading] = useState(true)
const [userTrackingHx, setUserTrackingHx] = useState([]);
const getUserTrackingHx = async () => {
try {
const res = await api.getUserTrackingHistory();
if(res.status == 200){
setUserTrackingHx([
{data: res.data.tracking_data},
]);
setIsLoading(false)
return
}
setIsLoading(false)
}catch(error) {
setIsLoading(false)
}
};
useEffect(() => {
getUserTrackingHx();
}, []);
console.log("IN TRACKING COMPO TRD", userTrackingHx);
return (
<>
<Layout>
<div className="history-wrapper w-full mb-10">
<div className="main-wrapper w-full">
<TrackCategory trackcategory={props.trackCategory} className="mb-10" />
<TrackingTable />
<TrackingTable userTrackingHx={userTrackingHx}/>
</div>
</div>
</Layout>