import React from 'react';
import superagent from 'superagent';
import { fromUnixTime } from "date-fns";
import { formatInTimeZone } from 'date-fns-tz'
import { Table, Segment } from 'semantic-ui-react'
import { DEFAULT_TIMEZONE } from '../../CloudApi/Constants.js';
export default class SocialUserHistory extends React.Component {
constructor(props) {
super(props);
this.state = {
userHistory: [],
};
}
async componentDidMount() {
this.setState({ loading: true });
try {
this.setState({ userHistory: [] });
const res = await superagent.get(`/cloud/admin/account/${this.props.account.id}/social/history/user`).accept('json');
const historyItems = res.body.items;
const userHistory = _.orderBy(historyItems, ["createdAt"], ["desc"]);
this.setState({ userHistory });
} catch (e) {
console.log(e);
}
this.setState({ loading: false });
}
render() {
if (this.state.loading) {
return