import React from 'react'; import superagent from 'superagent'; import { fromUnixTime, formatDistanceToNow, format } from "date-fns"; import { formatInTimeZone } from 'date-fns-tz' import { Segment, Table, Label } from 'semantic-ui-react' import { DEFAULT_TIMEZONE } from '../../CloudApi/Constants.js'; export default class AccountLogs extends React.Component { constructor(props) { super(props); this.state = { logs: [], }; } async componentDidMount() { try { this.setState({ loading: false, logs: [] }); const res = await superagent.get(`/api/admin/account/${this.props.account.id}/logs`).accept('json'); const logs = res.body; console.log(logs); this.setState({ logs }); } catch (e) { console.log(e); } } render() { if (this.state.logs == null || this.state.logs.length == 0) { return (