import React from "react"; import memory from "./memory"; import { Sources, StolenDataEntry } from "./request-cluster"; import { hyphenate } from "./util"; function StolenDataValueTable({ object, prefixKey = "", }: { object: Record; prefixKey: string; }) { return ( {Object.entries(object).map(([key, value]) => ( ))}
{hyphenate(key)}
); } function StolenDataValue({ value, prefixKey = "", }: { value: string | Record; prefixKey?: string; }) { if (!value) { return <>; } if (typeof value === "string") { return <>{value}; } return ; } export default function StolenDataCluster({ origin, shorthost, minValueLength, cookiesOnly, }: { origin: string; shorthost: string; refreshToken: number; minValueLength: number; cookiesOnly: boolean; }) { const cluster = memory.getClustersForOrigin(origin)[shorthost]; const icons: Record = { cookie: "🍪", pathname: "🛣", queryparams: "🅿", header: "H", }; return (

{cluster.id} {cluster.hasCookies() ? "🍪" : ""} x {cluster.requests.length}{" "} memory.removeCookiesFor(origin, shorthost)} > Wyczyść cookiesy

{cluster .getStolenData({ minValueLength, cookiesOnly }) .map((entry) => ( ))}
{entry.getNames().map(hyphenate).join(", ")} {entry.getSources().map((source) => icons[source])}
); }