51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
import { Form } from "antd";
|
|
import React from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
import JobSearchSelect from "../job-search-select/job-search-select.component";
|
|
import JobsDetailLaborContainer from "../jobs-detail-labor/jobs-detail-labor.container";
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
bodyshop: selectBodyshop,
|
|
});
|
|
|
|
export function TechClockInComponent({ form, bodyshop }) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<div>
|
|
<Form.Item
|
|
name="jobid"
|
|
label={t("jobs.fields.ro_number")}
|
|
rules={[
|
|
{
|
|
required: true,
|
|
message: t("general.validation.required"),
|
|
},
|
|
]}
|
|
>
|
|
<JobSearchSelect />
|
|
</Form.Item>
|
|
|
|
<Form.Item
|
|
shouldUpdate={(prevValues, curValues) =>
|
|
prevValues.jobid !== curValues.jobid
|
|
}
|
|
>
|
|
{() => {
|
|
if (!form.getFieldValue("jobid")) return null;
|
|
return (
|
|
<JobsDetailLaborContainer
|
|
jobId={form.getFieldValue("jobid")}
|
|
techConsole
|
|
/>
|
|
);
|
|
}}
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}
|
|
export default connect(mapStateToProps, null)(TechClockInComponent);
|