import React, { useEffect, useState } from 'react'; import { AuditLog } from '../types'; import { fetchLogs } from '../graphService'; const AuditLogs: React.FC = () => { const [logs, setLogs] = useState([]); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(''); const loadLogs = async () => { setIsLoading(true); try { const data = await fetchLogs(); setLogs(Array.isArray(data) ? data : []); setError(''); } catch (err: any) { setError(err.message); } finally { setIsLoading(false); } }; useEffect(() => { loadLogs(); }, []); if (isLoading) return
QUERYING SYSTEM JOURNALS...
; if (error) return (

LOG_FETCH_FAILURE: {error}

); return (

System Audit Journal

Chronological Modification Tracking

{logs.map((log) => ( ))} {logs.length === 0 && ( )}
Timestamp Identity Operation Object Details
{new Date(log.created_at).toLocaleString()} {log.username} {log.action_type} {log.entity_type} {log.entity_name} {log.details}
No system events logged in current period.
); }; export default AuditLogs;