import * as React from "react"; import { Row, Col } from "../../ui"; import { TaggedDiagnosticDump } from "farmbot"; import { destroy } from "../../api/crud"; import { ago } from "../connectivity/status_checks"; import { t } from "../../i18next_wrapper"; export interface Props { diag: TaggedDiagnosticDump; dispatch: Function; } export class DiagnosticDumpRow extends React.Component { get ticket() { return this.props.diag.body.ticket_identifier; } get age() { return ago(new Date(this.props.diag.body.created_at).getTime()); } destroy = () => this.props.dispatch(destroy(this.props.diag.uuid)); render() { return {t("Report {{ticket}} (Saved {{age}})", { ticket: this.ticket, age: this.age })} ; } }