diff --git a/client/src/pages/Alerts.jsx b/client/src/pages/Alerts.jsx index 40ef546..6eb9c21 100644 --- a/client/src/pages/Alerts.jsx +++ b/client/src/pages/Alerts.jsx @@ -16,6 +16,10 @@ const Alerts = () => { const [loading, setLoading] = useState(true); const [activeTab, setActiveTab] = useState('rules'); const [showCreateModal, setShowCreateModal] = useState(false); + const [showEditModal, setShowEditModal] = useState(false); + const [editingRule, setEditingRule] = useState(null); + const [showDetectionModal, setShowDetectionModal] = useState(false); + const [selectedDetection, setSelectedDetection] = useState(null); useEffect(() => { fetchAlertData(); @@ -50,6 +54,21 @@ const Alerts = () => { } }; + const handleEditRule = (rule) => { + setEditingRule(rule); + setShowEditModal(true); + }; + + const handleViewDetection = async (detectionId) => { + try { + const response = await api.get(`/detections/${detectionId}`); + setSelectedDetection(response.data.data); + setShowDetectionModal(true); + } catch (error) { + console.error('Error fetching detection details:', error); + } + }; + const getStatusIcon = (status) => { switch (status) { case 'sent': @@ -252,10 +271,7 @@ const Alerts = () => {