import * as React from "react"; import { McuInputBox } from "./mcu_input_box"; import { PinGuardMCUInputGroupProps } from "./interfaces"; import { Row, Col } from "../../ui/index"; import { settingToggle } from "../actions"; import { ToggleButton } from "../../controls/toggle_button"; import { isUndefined } from "lodash"; import { t } from "../../i18next_wrapper"; import { PinNumberDropdown } from "./pin_number_dropdown"; export function PinGuardMCUInputGroup(props: PinGuardMCUInputGroupProps) { const { sourceFwConfig, dispatch, label, pinNumKey, timeoutKey, activeStateKey } = props; const activeStateValue = sourceFwConfig(activeStateKey).value; const inactiveState = isUndefined(activeStateValue) ? undefined : !activeStateValue; return dispatch(settingToggle(activeStateKey, sourceFwConfig))} /> ; }