import React from "react"; import { RequestCluster } from "../request-cluster"; import { Classifications, Sources } from "../stolen-data-entry"; const emailClassifications: Record = { id: "sztucznie nadane mi ID", history: "część mojej historii przeglądania", }; const emailSources: Record = { header: "w nagłówku HTTP", cookie: "z pliku Cookie", pathname: "jako części adresu URL", queryparams: "jako część adresu URL (query-params)", }; export default function DomainSummary({ cluster, }: { cluster: RequestCluster; }) { return (
  • Właściciel domeny {cluster.id} otrzymał:{" "}
    • Mój adres IP
    • {cluster .getMarkedEntries() .sort((entryA, entryB) => (entryA.value > entryB.value ? -1 : 1)) .reduce((acc, entry, index, arr) => { if (index === 0) { return [entry]; } if (entry.value != arr[index - 1].value) { acc.push(entry); } return acc; }, []) .map((entry) => (
    • {emailClassifications[entry.classification]}{" "} {emailSources[entry.source]}  ({entry.name.trim()})
    • ))}
  • ); }