resolve issues with new features
This commit is contained in:
@@ -40,7 +40,7 @@ function UserOverviewTab() {
|
||||
const [sortKey, setSortKey] = useState<SortKey>('name');
|
||||
const [sortDir, setSortDir] = useState<SortDir>('asc');
|
||||
|
||||
const { data: users, isLoading } = useQuery({
|
||||
const { data: users, isLoading, isError } = useQuery({
|
||||
queryKey: ['admin', 'users'],
|
||||
queryFn: adminApi.getUsers,
|
||||
});
|
||||
@@ -82,6 +82,17 @@ function UserOverviewTab() {
|
||||
return <Box sx={{ display: 'flex', justifyContent: 'center', p: 4 }}><CircularProgress /></Box>;
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
<Box sx={{ p: 4, textAlign: 'center' }}>
|
||||
<Typography color="error" gutterBottom>Benutzerdaten konnten nicht geladen werden.</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Bitte versuchen Sie es später erneut.
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 2 }}>
|
||||
|
||||
Reference in New Issue
Block a user