Added sync button to job header IO-544

This commit is contained in:
Patrick Fic
2021-02-22 16:12:05 -08:00
parent b9ee0cca4f
commit 6cdae6b0d5
8 changed files with 65 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
import { Button } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { SyncOutlined } from "@ant-design/icons";
import { useHistory } from "react-router-dom";
export default function JobSyncButton({ job }) {
const { t } = useTranslation();
const history = useHistory();
const handleClick = () => {
history.push(
`/manage/available?availableJobId=${job.available_jobs[0].id}&clm_no=${job.clm_no}`
);
};
if (job && job.available_jobs && job.available_jobs.length > 0)
return (
<Button onClick={handleClick}>
<SyncOutlined />
{t("jobs.actions.sync")}
</Button>
);
else return null;
}