2017-09-26 13:05:01 -06:00
|
|
|
import * as React from "react";
|
2018-08-01 07:42:56 -06:00
|
|
|
import { SpecialStatus } from "farmbot";
|
2019-04-02 13:59:37 -06:00
|
|
|
import { t } from "../../i18next_wrapper";
|
2017-09-26 13:05:01 -06:00
|
|
|
|
|
|
|
interface RetryBtnProps {
|
|
|
|
flags: boolean[];
|
|
|
|
onClick(): void;
|
2017-11-06 16:54:52 -07:00
|
|
|
status: SpecialStatus;
|
2017-09-26 13:05:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export function RetryBtn(props: RetryBtnProps) {
|
|
|
|
const failures = props.flags.includes(false);
|
|
|
|
const color = failures ? "red" : "green";
|
|
|
|
const css = props.status === "SAVING" ? "yellow" : color;
|
2018-09-24 13:48:13 -06:00
|
|
|
return <button className={css + " fb-button"} onClick={props.onClick}>
|
2018-02-26 06:50:41 -07:00
|
|
|
{t("Check Again")}
|
2018-08-01 07:42:56 -06:00
|
|
|
</button>;
|
2017-09-26 13:05:01 -06:00
|
|
|
}
|