import React, { Fragment } from 'react'; import ReactDOM from 'react-dom'; import EmailContent from './components/report-window/email-content'; import { makeFakeClusters } from './components/report-window/fake-clusters'; class ErrorBoundary extends React.Component { constructor(props: any) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: any) { return { hasError: true, error }; } render() { if (this.state.hasError) { return

Something went wrong.

; } return this.props.children; } } function Diag() { const [json, setjson] = React.useState( JSON.stringify({ answers: { hosts: {} }, visited_url: '', fake_clusters_data: {} }) ); const { answers, visited_url, fake_clusters_data } = JSON.parse(json); const fake_clusters = makeFakeClusters(fake_clusters_data); return (
{ alert('download!'); }, user_role: 'user', }} />
); } ReactDOM.render( , document.getElementById('app') );