action refresh fixed

This commit is contained in:
victorAnumudu
2024-12-21 23:28:06 +01:00
parent 4e86fba581
commit 3680abbef2
5 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export default function RecentActions() {
return (
<>
<div className="card card-statistics h-100 mb-0 panel_round_c2">
<div className="card card-statistics h-100 mb-0 panel_round_c2" style={{minHeight: '460px'}}>
<div className="card-header">
<div className="card-heading">
<h4 className="card-title">Recent Actions</h4>
+7 -6
View File
@@ -1,16 +1,17 @@
import { useQuery } from '@tanstack/react-query'
import React from 'react'
import { recentActions } from '../../services/services'
import { topBar } from '../../services/services'
import queryKeys from '../../services/queryKeys'
export default function TopBar() {
const {data:dataAction, isFetching, isError, error} = useQuery({
queryKey: queryKeys.recentAction,
queryFn: () => recentActions()
const {data, isFetching, isError, error} = useQuery({
queryKey: queryKeys.topBar,
queryFn: () => topBar()
})
const actionData = dataAction?.data?.action_data
const topData = data?.data?.bar_data?.top_bar
console.log('TOP', topData)
return (
<>
@@ -30,7 +31,7 @@ export default function TopBar() {
</div>
:
<>
{actionData && actionData?.top_bar?.map((item, index)=>{
{topData && topData?.map((item, index)=>{
let textColor = item?.description == 'Contacts' ? 'text-danger' : item?.description == 'Site Traffic' ? 'text-primary' : item?.description == 'Appointments' ? 'text-orange' : 'text-success'
return (
<div key={item.id + index} className="col-sm-6 col-xxl-3">