import { useParams } from 'react-router-dom'; import { TrendingUp } from 'lucide-react'; import { useTopbar } from '../../topbar'; import { BackButton, Card, EmptyState, ErrorText, PageHeader, Skeleton } from '../../components/ui'; import ExerciseProgressCards from '../../components/ExerciseProgressCards'; import { useUserExerciseProgress } from './user-queries'; /** * Postępy per ćwiczenie użytkownika — widok admina 1:1 z `/profile/progress` * z aplikacji (czyt. opis wzoru 1RM usunięty z obu stron). */ export default function UserProgress() { const { id } = useParams(); useTopbar({ title: 'Postępy', back: id ? `/users/${id}` : '/users' }); const { data, isLoading, error } = useUserExerciseProgress(id); if (isLoading) { return (
); } const exercises = data?.exercises ?? []; return ( <> } /> {error && Błąd: {(error as Error).message}} {!error && exercises.length === 0 && ( )} {!error && exercises.length > 0 && } ); }