diff --git a/frontend/src/components/forms/SearchForm.tsx b/frontend/src/components/forms/SearchForm.tsx index 878a2d1..69d6ac7 100644 --- a/frontend/src/components/forms/SearchForm.tsx +++ b/frontend/src/components/forms/SearchForm.tsx @@ -8,24 +8,24 @@ import { SnackbarConfig } from "../../types/Config.ts"; type SearchFormProps = { setSearchResults: Dispatch>; setSnackbarConfig: Dispatch>; - setLoadingTickets: Dispatch>; + setPendingRequest: Dispatch>; }; export default function SearchForm({ setSearchResults, setSnackbarConfig, - setLoadingTickets, + setPendingRequest, }: Readonly) { function searchTickets(event: FormEvent) { event.preventDefault(); - setLoadingTickets(true); + setPendingRequest(true); getAllTickets(searchText) .then((response) => { - setLoadingTickets(false); + setPendingRequest(false); setSearchResults(response.data); }) .catch((error) => { - setLoadingTickets(false); + setPendingRequest(false); setSnackbarConfig({ open: true, severity: "error", diff --git a/frontend/src/components/navbars/MainNavBar.tsx b/frontend/src/components/navbars/MainNavBar.tsx index 3a7a09f..6295bbb 100644 --- a/frontend/src/components/navbars/MainNavBar.tsx +++ b/frontend/src/components/navbars/MainNavBar.tsx @@ -9,13 +9,13 @@ import { SidepanelConfig } from "../../types/Config.ts"; type NavBarProps = { user: User | null | undefined; setSidepanelConfig: Dispatch>; - loadingTickets: boolean; + pendingRequest: boolean; }; export default function MainNavBar({ user, setSidepanelConfig, - loadingTickets, + pendingRequest, }: Readonly) { return ( @@ -26,8 +26,8 @@ export default function MainNavBar({ {user && } - {loadingTickets && ( - + {pendingRequest && ( + diff --git a/frontend/src/components/pages/MainPage.tsx b/frontend/src/components/pages/MainPage.tsx index fd6279c..299bbf7 100644 --- a/frontend/src/components/pages/MainPage.tsx +++ b/frontend/src/components/pages/MainPage.tsx @@ -32,7 +32,6 @@ export default function MainPage({ message: "Initial value", }); const [confirmDeletion, setConfirmDeletion] = useState(false); - const [loadingTickets, setLoadingTickets] = useState(false); const [pendingRequest, setPendingRequest] = useState(false); return ( @@ -40,14 +39,14 @@ export default function MainPage({