complete and check auth pages - error handler

This commit is contained in:
Alihaghighattalab
2024-08-26 17:59:20 +03:30
parent 5ec6ffdacc
commit 10a6a746ed
20 changed files with 137 additions and 56 deletions
+6 -1
View File
@@ -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">