resolve issues with new features
This commit is contained in:
@@ -13,6 +13,7 @@ import { Link as RouterLink } from 'react-router-dom';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { vehiclesApi } from '../../services/vehicles';
|
||||
import { equipmentApi } from '../../services/equipment';
|
||||
import { useCountUp } from '../../hooks/useCountUp';
|
||||
import type { VehicleStats, InspectionAlert } from '../../types/vehicle.types';
|
||||
import type { VehicleEquipmentWarning } from '../../types/equipment.types';
|
||||
|
||||
@@ -38,6 +39,9 @@ const VehicleDashboardCard: React.FC<VehicleDashboardCardProps> = ({
|
||||
queryFn: () => equipmentApi.getVehicleWarnings(),
|
||||
});
|
||||
|
||||
const animatedReady = useCountUp(stats?.einsatzbereit ?? 0);
|
||||
const animatedTotal = useCountUp(stats?.total ?? 0);
|
||||
|
||||
const loading = statsLoading || alertsLoading || warningsLoading;
|
||||
|
||||
if (loading) {
|
||||
@@ -89,7 +93,7 @@ const VehicleDashboardCard: React.FC<VehicleDashboardCardProps> = ({
|
||||
|
||||
{/* Main metric */}
|
||||
<Typography variant="h4" fontWeight={700} color={allGood ? 'success.main' : 'text.primary'}>
|
||||
{stats.einsatzbereit}/{stats.total}
|
||||
{animatedReady}/{animatedTotal}
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 1.5 }}>
|
||||
einsatzbereit
|
||||
|
||||
Reference in New Issue
Block a user