This commit is contained in:
Matthias Hochmeister
2026-03-26 16:12:18 +01:00
parent 19dd528765
commit 03f489d546
5 changed files with 40 additions and 102 deletions

View File

@@ -6,10 +6,9 @@ import {
Card,
CardContent,
CircularProgress,
Link,
Typography,
} from '@mui/material';
import { Link as RouterLink } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { atemschutzApi } from '../../services/atemschutz';
import { useCountUp } from '../../hooks/useCountUp';
@@ -22,6 +21,7 @@ interface AtemschutzDashboardCardProps {
const AtemschutzDashboardCard: React.FC<AtemschutzDashboardCardProps> = ({
hideWhenEmpty = false,
}) => {
const navigate = useNavigate();
const { data: stats, isLoading, isError } = useQuery<AtemschutzStats>({
queryKey: ['atemschutz-stats'],
queryFn: () => atemschutzApi.getStats(),
@@ -68,7 +68,7 @@ const AtemschutzDashboardCard: React.FC<AtemschutzDashboardCardProps> = ({
if (hideWhenEmpty && allGood) return null;
return (
<Card sx={{ height: '100%' }}>
<Card sx={{ height: '100%', cursor: 'pointer' }} onClick={() => navigate('/atemschutz')}>
<CardContent>
<Typography variant="h6" gutterBottom>
Atemschutz
@@ -124,18 +124,6 @@ const AtemschutzDashboardCard: React.FC<AtemschutzDashboardCardProps> = ({
Alle Atemschutzträger einsatzbereit
</Typography>
)}
{/* Link to management page */}
<Box sx={{ mt: 2 }}>
<Link
component={RouterLink}
to="/atemschutz"
underline="hover"
variant="body2"
>
Zur Verwaltung
</Link>
</Box>
</CardContent>
</Card>
);