import { GenerateResult } from "@/types/shell"; import { TFunction } from "i18next"; import { Fragment } from "react/jsx-runtime"; import { CodeViewer } from "../code-viewer"; import { AgentResult } from "./agent"; import { JarResult } from "./jar-result"; import { MultiPackResult } from "./multi-packer"; export function ResultComponent({ packResult, allPackResults, packMethod, t, generateResult, }: Readonly<{ packResult: string | undefined; allPackResults: Map | undefined; packMethod: string; t: TFunction; generateResult?: GenerateResult; }>) { const showCode = packMethod === "JSP"; const isAgent = packMethod.startsWith("Agent"); const isJar = packMethod === "Jar"; if (allPackResults) { return ; } if (isAgent) { return ; } if (isJar) { return ; } if (!isAgent && !isJar) { return ( {t("packageConfig.title")}:{packMethod} ({packResult?.length}) } wrapLongLines={!showCode} showLineNumbers={showCode} language={showCode ? "java" : "text"} height={350} /> ); } return null; }