2017-07-26 14:29:35 -06:00
|
|
|
import * as React from "react";
|
2018-01-20 07:46:44 -07:00
|
|
|
import { Row, Col } from "../ui/index";
|
2017-07-26 14:29:35 -06:00
|
|
|
import { AxisDisplayGroupProps } from "./interfaces";
|
2017-12-12 13:41:04 -07:00
|
|
|
import { isNumber } from "lodash";
|
2019-04-02 13:59:37 -06:00
|
|
|
import { t } from "../i18next_wrapper";
|
2020-02-28 09:34:28 -07:00
|
|
|
import { Xyz } from "farmbot";
|
2017-12-12 13:41:04 -07:00
|
|
|
|
2020-02-28 09:34:28 -07:00
|
|
|
const Axis = ({ axis, val }: { val: number | undefined, axis: Xyz }) =>
|
|
|
|
<Col xs={3}>
|
|
|
|
<input disabled name={axis} value={isNumber(val) ? val : "---"} />
|
|
|
|
</Col>;
|
2017-07-26 14:29:35 -06:00
|
|
|
|
2019-12-10 12:53:20 -07:00
|
|
|
export const AxisDisplayGroup = ({ position, label }: AxisDisplayGroupProps) => {
|
2017-08-28 05:44:37 -06:00
|
|
|
const { x, y, z } = position;
|
|
|
|
return <Row>
|
2020-02-28 09:34:28 -07:00
|
|
|
<Axis axis={"x"} val={x} />
|
|
|
|
<Axis axis={"y"} val={y} />
|
|
|
|
<Axis axis={"z"} val={z} />
|
2017-08-28 05:44:37 -06:00
|
|
|
<Col xs={3}>
|
|
|
|
<label>
|
|
|
|
{t(label)}
|
|
|
|
</label>
|
|
|
|
</Col>
|
|
|
|
</Row>;
|
2017-07-26 14:29:35 -06:00
|
|
|
};
|