2
0

feat(inputs): Add number input

This commit is contained in:
Baptiste Arnaud
2022-01-08 07:40:55 +01:00
parent 2a040308db
commit d54ebc0cbe
33 changed files with 467 additions and 207 deletions

View File

@ -1,4 +1,12 @@
import { Table } from 'models'
import {
BubbleStepType,
InputStep,
InputStepType,
Step,
Table,
TextInputStep,
TextStep,
} from 'models'
export const sendRequest = async <ResponseData>({
url,
@ -32,3 +40,12 @@ export const filterTable = <T>(ids: string[], table: Table<T>): Table<T> => ({
byId: ids.reduce((acc, id) => ({ ...acc, [id]: table.byId[id] }), {}),
allIds: ids,
})
export const isInputStep = (step: Step): step is InputStep =>
(Object.values(InputStepType) as string[]).includes(step.type)
export const isTextBubbleStep = (step: Step): step is TextStep =>
step.type === BubbleStepType.TEXT
export const isTextInputStep = (step: Step): step is TextInputStep =>
step.type === InputStepType.TEXT