complete and check auth pages - error handler
This commit is contained in:
@@ -5,9 +5,10 @@ import { getOverviewDetails } from "../../services/api/overview"
|
||||
import { useEffect, useState } from "react"
|
||||
import { Coin1, DollarCircle, Radar, Star } from "iconsax-react"
|
||||
import { HomeStatusSkeleton } from "./status-skeleton"
|
||||
import { handleError } from "../../utility/error-handle"
|
||||
|
||||
export const StatusBox = () => {
|
||||
const { data, isLoading } = useQuery({
|
||||
const { data, isLoading, error } = useQuery({
|
||||
queryKey: ['overview'],
|
||||
queryFn: getOverviewDetails
|
||||
})
|
||||
@@ -40,6 +41,10 @@ export const StatusBox = () => {
|
||||
}])
|
||||
}, [data])
|
||||
|
||||
useEffect(() => {
|
||||
handleError(error)
|
||||
}, [error])
|
||||
|
||||
if (isLoading) return <HomeStatusSkeleton />
|
||||
return (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 2xl:grid-cols-4 gap-6">
|
||||
|
||||
Reference in New Issue
Block a user