From b7b768760825fa0b8240a8741ff2d63830c7ef98 Mon Sep 17 00:00:00 2001 From: Jesulayomy Date: Thu, 10 Jul 2025 21:54:27 -0400 Subject: [PATCH] [PageSpeed]: Loading states from hooks, unused classnames, conditional calling of hook removed --- client/src/Pages/PageSpeed/Create/index.jsx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/client/src/Pages/PageSpeed/Create/index.jsx b/client/src/Pages/PageSpeed/Create/index.jsx index 8941d8c9a..7c6042fad 100644 --- a/client/src/Pages/PageSpeed/Create/index.jsx +++ b/client/src/Pages/PageSpeed/Create/index.jsx @@ -84,13 +84,11 @@ const PageSpeedSetup = () => { useGetNotificationsByTeamId(); // Hooks for API actions + const [isLoading] = useFetchMonitorById({ monitorId, setMonitor, updateTrigger }); const [createMonitor, isCreating] = useCreateMonitor(); - const [isLoading] = isCreate - ? [false] - : useFetchMonitorById({ monitorId, setMonitor, updateTrigger }); - const [deleteMonitor] = useDeleteMonitor(); - const [updateMonitor] = useUpdateMonitor(); - const [pauseMonitor] = usePauseMonitor(); + const [deleteMonitor, isDeleting] = useDeleteMonitor(); + const [updateMonitor, isUpdating] = useUpdateMonitor(); + const [pauseMonitor, isPausing] = usePauseMonitor(); // Handlers const onSubmit = async (event) => { @@ -186,7 +184,6 @@ const PageSpeedSetup = () => { return ( { { >