backuping up stuff
This commit is contained in:
1 parent
9ec15d5ab9
commit
7127c3c0b9
19 files changed
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import InputNumber from "../../components/InputNumber";
|
||||
import InputText from "../../components/InputText";
|
||||
import InputYaml from "../../components/InputYaml";
|
||||
import { RepeatScript } from "../types/script";
|
||||
import { BaseState } from "./BaseState";
|
||||
|
||||
|
||||
export default class ScriptRepeatState extends BaseState<RepeatScript> {
|
||||
defaultState = () => ({
|
||||
alias: "Repeat",
|
||||
repeat: {
|
||||
count: 1,
|
||||
sequence: [],
|
||||
}
|
||||
})
|
||||
isReady(state: RepeatScript): boolean {
|
||||
return state.alias !== '' &&
|
||||
state?.repeat?.sequence.length > 0
|
||||
}
|
||||
renderOptionList(state: RepeatScript): JSX.Element {
|
||||
return <div className="state-manager-options">
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.alias ?? ""}
|
||||
onChange={alias => this.setState({...state, alias})}
|
||||
/>
|
||||
<InputNumber
|
||||
label="How many times?"
|
||||
value={state?.repeat?.count}
|
||||
onChange={count => this.setState({...state, repeat: {...state.repeat, count}})}
|
||||
/>
|
||||
<InputYaml
|
||||
label="Sequence"
|
||||
value={state?.repeat?.sequence ?? {}}
|
||||
onChange={sequence => this.setState({...state, repeat: {...state.repeat, sequence}})}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user