import { Component, linkEvent } from "inferno"; import { T } from "inferno-i18next-dess"; import { PrivateMessageReportView, ResolvePrivateMessageReport, } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { WebSocketService } from "../../services"; import { mdToHtml, myAuth, wsClient } from "../../utils"; import { Icon } from "../common/icon"; import { PersonListing } from "../person/person-listing"; interface Props { report: PrivateMessageReportView; } export class PrivateMessageReport extends Component { constructor(props: any, context: any) { super(props, context); } render() { let r = this.props.report; let pmr = r.private_message_report; let tippyContent = i18n.t( r.private_message_report.resolved ? "unresolve_report" : "resolve_report" ); return (
{i18n.t("creator")}:{" "}
{i18n.t("message")}:
{i18n.t("reporter")}:
{i18n.t("reason")}: {pmr.reason}
{r.resolver && (
{pmr.resolved ? ( # ) : ( # )}
)}
); } handleResolveReport(i: PrivateMessageReport) { let pmr = i.props.report.private_message_report; let auth = myAuth(); if (auth) { let form: ResolvePrivateMessageReport = { report_id: pmr.id, resolved: !pmr.resolved, auth, }; WebSocketService.Instance.send( wsClient.resolvePrivateMessageReport(form) ); } } }