rune
Version:
CLI to upload your games to Rune
20 lines (19 loc) • 828 B
JavaScript
import { Box, Text } from "ink";
import React, { useState } from "react";
import { ChooseGameStep } from "../Upload/ChooseGameStep.js";
import { UpdateAll } from "./UpdateAll.js";
import { UpdateGameStep } from "./UpdateGameStep.js";
export function Update({ args }) {
const [gameId, setGameId] = useState();
if (args[0]) {
if (args[0] === "all")
return React.createElement(UpdateAll, { args: args });
return React.createElement(Text, { color: "red" },
"Invalid argument `",
args[0],
"`");
}
return (React.createElement(Box, { flexDirection: "column" },
React.createElement(ChooseGameStep, { currentGameId: gameId, onComplete: setGameId, onlyExisting: true }),
gameId && React.createElement(UpdateGameStep, { gameId: gameId })));
}