import React from 'react'; import { fromUnixTime, formatDistanceToNow, format } from "date-fns"; import { formatInTimeZone } from 'date-fns-tz'; import { DEFAULT_TIMEZONE } from '../../CloudApi/Constants.js'; import { Segment, Header, Image, Table } from 'semantic-ui-react' class AccountReport extends React.Component { constructor(props) { super(props); } render() { if (!this.props.report) { return
; } let reporterAccount = (
); let targetAccount = (
); if (this.props.report.reporterAccount) { reporterAccount = (
Report #{this.props.reportIndex + 1} Reported by: {this.props.report.reporterAccount.username}
) } if (this.props.report.targetAccount) { targetAccount = ( Reported Account
{this.props.report.targetAccount.username}
) } return (
{reporterAccount} {targetAccount} Reason {this.props.report.reason} Room name {this.props.report.roomName} Room description {this.props.report.roomDescription} Room Admin {this.props.report.roomAdminUsername} Room Type {this.props.report.roomType} Created At {formatInTimeZone(fromUnixTime(this.props.report.createdAt._seconds), DEFAULT_TIMEZONE, 'PPPp z')}
) } } export default AccountReport;