import React from 'react' import { AuditLogEntry, findAuditLogs } from '../../../providers/Config/helpers' import CircularProgress from '../../CircularProgress' import Modal from '../../Modal' import LogEntry from './LogEntry' import './AuditLogModal.scss' interface AuditLogModalProps { open: boolean onClose: () => void } const AuditLogModal: React.FC = ({ open, onClose }) => { const [isLoading, setLoading] = React.useState(true) const [logs, setLogs] = React.useState([]) React.useEffect(() => { if (!open) return setLoading(true) findAuditLogs() .then(setLogs) .finally(() => setLoading(false)) }, [open]) return ( {!isLoading ? ( logs.map((entry) => ) ) : (
)}
) } export default AuditLogModal