// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import LoadingScreen from 'components/loading_screen.jsx'; import AuditTable from 'components/audit_table.jsx'; import ComplianceReports from 'components/admin_console/compliance_reports'; import React from 'react'; import PropTypes from 'prop-types'; import {FormattedMessage} from 'react-intl'; export default class Audits extends React.PureComponent { static propTypes = { /* * Array of audits to render */ audits: PropTypes.arrayOf(PropTypes.object).isRequired, actions: PropTypes.shape({ /* * Function to fetch audits */ getAudits: PropTypes.func.isRequired }).isRequired } constructor(props) { super(props); this.state = { loadingAudits: true }; } componentDidMount() { this.props.actions.getAudits().then( () => this.setState({loadingAudits: false}) ); } reload = () => { this.setState({loadingAudits: true}); this.props.actions.getAudits().then( () => this.setState({loadingAudits: false}) ); } render() { let content = null; if (global.window.mm_license.IsLicensed !== 'true') { return
; } if (this.state.loadingAudits) { content = ; } else { content = (
); } return (

{content}
); } }