import { DeleteFilled, PlusCircleFilled } from "@ant-design/icons"; import { Button, Col, Popover, Row, Select, Space, Spin } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectJobReadOnly } from "../../redux/application/application.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; import DataLabel from "../data-label/data-label.component"; import InstanceRenderManager from "../../utils/instanceRenderMgr"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, jobRO: selectJobReadOnly }); const mapDispatchToProps = (dispatch) => ({ //setUserLanguage: language => dispatch(setUserLanguage(language)) }); const iconStyle = { marginLeft: ".3rem" }; export function JobEmployeeAssignments({ bodyshop, jobRO, body, refinish, prep, csr, handleAdd, handleRemove, loading }) { const { t } = useTranslation(); const [assignment, setAssignment] = useState({ operation: null, employeeid: null }); const [visibility, setVisibility] = useState(false); const onChange = (value, option) => { setAssignment({ ...assignment, employeeid: value, name: option.name }); }; const popContent = ( ); return ( {body ? (
{`${body.first_name || ""} ${body.last_name || ""}`} !jobRO && handleRemove("body")} />
) : ( { if (!jobRO) { setAssignment({ operation: "body" }); setVisibility(true); } }} /> )}
{prep ? (
{`${prep.first_name || ""} ${prep.last_name || ""}`} !jobRO && handleRemove("prep")} />
) : ( { if (!jobRO) { setAssignment({ operation: "prep" }); setVisibility(true); } }} /> )}
{refinish ? (
{`${refinish.first_name || ""} ${refinish.last_name || ""}`} !jobRO && handleRemove("refinish")} />
) : ( { if (!jobRO) { setAssignment({ operation: "refinish" }); setVisibility(true); } }} /> )}
{csr ? (
{`${csr.first_name || ""} ${csr.last_name || ""}`} !jobRO && handleRemove("csr")} />
) : ( { if (!jobRO) { setAssignment({ operation: "csr" }); setVisibility(true); } }} /> )}
); } export default connect(mapStateToProps, mapDispatchToProps)(JobEmployeeAssignments);