♻️ move olm install command to its own component

This commit is contained in:
Fred KISSIE
2026-01-21 05:22:49 +01:00
parent 310c6c90a3
commit 718d2122a4
5 changed files with 258 additions and 324 deletions

View File

@@ -31,19 +31,22 @@ export type NewtSiteInstallCommandsProps = {
id: string;
secret: string;
endpoint: string;
version: string;
version?: string;
};
export function NewtSiteInstallCommands({
id,
secret,
endpoint,
version
version = "latest"
}: NewtSiteInstallCommandsProps) {
const t = useTranslations();
const [platform, setPlatform] = useState<Platform>("unix");
const [acceptClients, setAcceptClients] = useState(true);
const [platform, setPlatform] = useState<Platform>("unix");
const [architecture, setArchitecture] = useState(
() => getArchitectures(platform)[0]
);
const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
const acceptClientsEnv = !acceptClients
@@ -133,10 +136,6 @@ WantedBy=default.target`
}
};
const [architecture, setArchitecture] = useState(
() => getArchitectures(platform)[0]
);
const commands = commandList[platform][architecture];
return (