import * as React from "react"; import { StepButton } from "./step_buttons"; import { scrollToBottom } from "../util"; import { Row } from "../ui/index"; import { TaggedSequence } from "farmbot"; import { CONFIG_DEFAULTS } from "farmbot/dist/config"; import { ShouldDisplay, Feature } from "../devices/interfaces"; import { MessageType } from "./interfaces"; import { t } from "../i18next_wrapper"; import { NOTHING_SELECTED } from "./locals_list/handle_select"; export interface StepButtonProps { dispatch: Function; current: TaggedSequence | undefined; shouldDisplay: ShouldDisplay; stepIndex: number | undefined; } export function StepButtonCluster(props: StepButtonProps) { const { dispatch, current, shouldDisplay, stepIndex } = props; const commonStepProps = { dispatch, current, index: stepIndex }; const ALL_THE_BUTTONS = [ {t("MOVE TO")} , {t("MOVE RELATIVE")} , {t("CONTROL PERIPHERAL")} , {t("READ SENSOR")} , {t("CONTROL SERVO")} , {t("WAIT")} , {t("SEND MESSAGE")} , {t("REBOOT")} , {t("SHUTDOWN")} , {t("E-STOP")} , {t("Find Home")} , {t("Set Zero")} , {t("Calibrate")} , {t("IF STATEMENT")} , {t("EXECUTE SEQUENCE")} , {t("Run Farmware")} , {t("TAKE PHOTO")} , {t("ASSERTION")} , ]; shouldDisplay(Feature.update_resource) && ALL_THE_BUTTONS.push( {t("Mark As...")} ); return
{ALL_THE_BUTTONS.map((stepButton, inx) =>
scrollToBottom("sequenceDiv")}> {stepButton}
)}
; }