import { useTranslation } from "react-i18next"; import CodeViewer from "@/components/code-viewer"; import type { MemShellResult } from "@/types/memshell"; import { AgentResult } from "./agent"; import { JarResult } from "./jar-result"; import { MultiPackResult } from "./multi-packer"; export function ResultComponent({ packResult, allPackResults, packMethod, generateResult, }: Readonly<{ packResult: string | undefined; allPackResults: Map | undefined; packMethod: string; generateResult?: MemShellResult; }>) { const showCode = packMethod === "JSP"; const isAgent = packMethod.startsWith("Agent"); const isJar = packMethod.endsWith("Jar"); const { t } = useTranslation(); if (allPackResults) { return ( ); } if (isAgent) { return ( ); } if (isJar) { return ( ); } return ( {t("common:packerMethod")}:{packMethod} ({packResult?.length}) } wrapLongLines={!showCode} showLineNumbers={showCode} language={showCode ? "java" : "text"} height={350} /> ); }