import React from "react"; import ReactDOM from "react-dom"; import { getMemory } from "../memory"; import { Classifications } from "../stolen-data-entry"; import { reduceConcat, useEmitter } from "../util"; import EmailTemplate from "./email-template"; import HARConverter from "./har-converter"; function Report() { const origin = new URL(document.location.toString()).searchParams.get( "origin" ); const [counter, setCounter] = useEmitter(getMemory()); function refresh() { setCounter((c) => c + 1); } const clusters = getMemory().getClustersForOrigin(origin); const marks = Object.values(clusters) .map((cluster) => cluster.getMarkedRequests()) .reduce(reduceConcat, []) .map((request) => request.getMarkedEntries()) .reduce(reduceConcat, []) .map((entry) => entry.marks) .reduce(reduceConcat, []); return (

Generuj treść maila dla {origin}

{marks.map((mark) => ( ))}
Adres docelowy Źródło danych Treść danych Klasyfikacja
{mark.shorthost} {mark.source}:{mark.name} {mark.key} {mark.valuePreview} {/* always gonna have one key, because unwrapEntry is called above */}
); } ReactDOM.render(, document.getElementById("app"));