dashboard API added
This commit is contained in:
@@ -1,9 +1,43 @@
|
||||
import React from "react";
|
||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { accountDashboard } from "../../services/services";
|
||||
import queryKeys from "../../services/queryKeys";
|
||||
import MainLoaderBS from "../loaders/MainLoaderBS";
|
||||
|
||||
|
||||
export default function HomeSections(){
|
||||
|
||||
const {data:dashData, isFetching, isError} = useQuery({
|
||||
queryKey: queryKeys.dashboard,
|
||||
queryFn: accountDashboard()
|
||||
})
|
||||
|
||||
console.log('DASH', dashData)
|
||||
|
||||
if(isFetching){
|
||||
return(
|
||||
<>
|
||||
{/* <MainLoaderBS /> */}
|
||||
<div className="row">
|
||||
<div className="col-12">
|
||||
<p className='text-success'>Loading...</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
if(isError){
|
||||
return (
|
||||
<div className="row">
|
||||
<div className="col-12">
|
||||
<p className='text-danger'>Error occured! Please refresh to continue</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return <>
|
||||
{/* <div className="row">
|
||||
<div className="col-md-12 m-b-30">
|
||||
|
||||
Reference in New Issue
Block a user