Skip to content

Commit 5982040

Browse files
committed
chore: add error message for not finding users, add loading spinner
1 parent c77f9be commit 5982040

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

apps/web/src/routes/_app/dashboard.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
22

3-
import { Dialog, Heading, Select, StatisticCard } from '@douglasneuroinformatics/libui/components';
3+
import { Dialog, Heading, Select, Spinner, StatisticCard } from '@douglasneuroinformatics/libui/components';
44
import { useTheme, useTranslation } from '@douglasneuroinformatics/libui/hooks';
55
import type { Theme } from '@douglasneuroinformatics/libui/hooks';
66
import { ClipboardDocumentIcon, DocumentTextIcon, UserIcon, UsersIcon } from '@heroicons/react/24/solid';
@@ -202,6 +202,15 @@ const RouteComponent = () => {
202202
</Dialog.Header>
203203
<hr></hr>
204204
<ul className="flex flex-col gap-5 overflow-auto">
205+
{userInfoQuery.isLoading && <Spinner />}
206+
{userInfoQuery.isError && (
207+
<p>
208+
{t({
209+
en: 'Error finding users',
210+
fr: "erreur lors de la recherche d'utilisateurs"
211+
})}
212+
</p>
213+
)}
205214
<AnimatePresence mode="popLayout">
206215
{userInfoQuery.data?.map((user, i) => {
207216
return (

0 commit comments

Comments
 (0)