36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import * as React from "react";
|
|
import { Row, Col } from "../../../ui/index";
|
|
import { ColWidth } from "../farmbot_os_settings";
|
|
import { ToggleButton } from "../../../controls/toggle_button";
|
|
import { updateConfig } from "../../actions";
|
|
import { Content, DeviceSetting } from "../../../constants";
|
|
import { AutoUpdateRowProps } from "./interfaces";
|
|
import { t } from "../../../i18next_wrapper";
|
|
import { Highlight } from "../maybe_highlight";
|
|
|
|
export function AutoUpdateRow(props: AutoUpdateRowProps) {
|
|
const osAutoUpdate = props.sourceFbosConfig("os_auto_update");
|
|
|
|
return <Row>
|
|
<Highlight settingName={DeviceSetting.farmbotOSAutoUpdate}>
|
|
<Col xs={ColWidth.label}>
|
|
<label>
|
|
{t(DeviceSetting.farmbotOSAutoUpdate)}
|
|
</label>
|
|
</Col>
|
|
<Col xs={ColWidth.description}>
|
|
<p>
|
|
{t(Content.OS_AUTO_UPDATE)}
|
|
</p>
|
|
</Col>
|
|
<Col xs={ColWidth.button}>
|
|
<ToggleButton toggleValue={osAutoUpdate.value}
|
|
dim={!osAutoUpdate.consistent}
|
|
toggleAction={() => props.dispatch(updateConfig({
|
|
os_auto_update: !osAutoUpdate.value
|
|
}))} />
|
|
</Col>
|
|
</Highlight>
|
|
</Row>;
|
|
}
|