'use client'; import { useState } from 'react'; import { buildScriptCommand, buildDockerRun, buildDockerCompose, type InstallMethod, type InstallOptions, } from '@/lib/xray/install'; import { ToolFrame } from './tool-frame'; import { TextField, SelectField, CheckboxField } from './shared/fields'; import { OutputBlock } from './shared/output-block'; export function InstallCommandBuilder() { const [method, setMethod] = useState('script'); const [version, setVersion] = useState(''); const [enableFail2ban, setEnableFail2ban] = useState(true); const [panelPort, setPanelPort] = useState(''); const [webBasePath, setWebBasePath] = useState(''); const options: InstallOptions = { method, version, enableFail2ban, panelPort, webBasePath, }; return (
setMethod(v as InstallMethod)} options={['script', 'docker']} /> {method === 'docker' ? ( <> ) : null}
{method === 'script' ? ( ) : ( <> )}
); }