diff --git a/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx b/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx index 1d4d45321..b9214921a 100644 --- a/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx +++ b/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx @@ -36,34 +36,6 @@ const NotificationLookup = () => { const [searching, setSearching] = useState(false); const [error, setError] = useState(null); const [notifications, setNotifications] = useState([]); - - const lookupRef = useRef(null); - - const lookup = async () => { - const query = lookupRef.current.value; - - if (!query.trim()) { - setError('Please enter a valid dismiss key.'); - return; - } - - setSearching(true); - setError(null); - - try { - const res = await request.get(`/admin/notification/lookup/${query}`); - if (res.body) { - setFoundNotification(res.body); - } else { - setFoundNotification(null); - setError('No notification found.'); - } - } catch { - setError('Error fetching notification.'); - } finally { - setSearching(false); - } - }; const lookupAll = async () => { setSearching(true); @@ -103,22 +75,6 @@ const NotificationLookup = () => { } }; - const renderFoundNotification = () => { - if (error) { - return
{error}
; - } - - if (!foundNotification) { - return
No notification found.
; - } - - return ( -
- -
- ); - }; - const renderNotificationsList = () => { if (error) { return
{error}
; @@ -129,45 +85,22 @@ const NotificationLookup = () => { } return ( -
+
+ ); }; return (
-
-

Lookup by dissmiss key

- { - if (e.key === 'Enter') { - lookup(); - } - }} - placeholder="dismiss key" - /> - - - {renderFoundNotification()} -
-
-

Check all Notifications

- + {renderNotificationsList()} -
); };