import CodeCopyButton from "@/components/ui/code-copy-button"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { basePath } from "@/config/siteConfig"; import { Script } from "@/lib/types"; import { getDisplayValueFromType } from "../ScriptInfoBlocks"; const getInstallCommand = (scriptPath?: string, isAlpine = false) => { return `bash -c "$(wget -q${isAlpine ? "" : "L"}O - https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`; }; export default function InstallCommand({ item }: { item: Script }) { const alpineScript = item.install_methods.find( (method) => method.type === "alpine", ); const defaultScript = item.install_methods.find( (method) => method.type === "default", ); const renderInstructions = (isAlpine = false) => ( <>

{isAlpine ? ( <> As an alternative option, you can use Alpine Linux and the{" "} {item.name} package to create a {item.name}{" "} {getDisplayValueFromType(item.type)} container with faster creation time and minimal system resource usage. You are also obliged to adhere to updates provided by the package maintainer. ) : item.type == "misc" ? ( <> To use the {item.name} script, run the command below in the shell. ) : ( <> {" "} To create a new Proxmox VE {item.name}{" "} {getDisplayValueFromType(item.type)}, run the command below in the Proxmox VE Shell. )}

{isAlpine && (

To create a new Proxmox VE Alpine-{item.name}{" "} {getDisplayValueFromType(item.type)}, run the command below in the Proxmox VE Shell

)} ); return (
{alpineScript ? ( Default Alpine Linux {renderInstructions()} {getInstallCommand(defaultScript?.script)} {renderInstructions(true)} {getInstallCommand(alpineScript.script, true)} ) : defaultScript?.script ? ( <> {renderInstructions()} {getInstallCommand(defaultScript.script)} ) : null}
); }