47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
import { DownOutlined } from "@ant-design/icons";
|
|
import { Dropdown, Menu } from "antd";
|
|
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
bodyshop: selectBodyshop,
|
|
});
|
|
|
|
export function JobsDetailChangeFilehandler({ disabled, form, bodyshop }) {
|
|
const handleClick = ({ item, key, keyPath }) => {
|
|
const est = item.props.value;
|
|
form.setFieldsValue(est);
|
|
};
|
|
|
|
const menu = (
|
|
<Menu
|
|
onClick={handleClick}
|
|
style={{
|
|
columnCount: Math.floor(bodyshop.md_filehandlers.length / 10) + 1,
|
|
}}
|
|
>
|
|
{bodyshop.md_filehandlers.map((est, idx) => (
|
|
<Menu.Item value={est} key={idx} style={{ breakInside: "avoid" }}>
|
|
{`${est.ins_ct_fn} ${est.ins_ct_ln}`}
|
|
</Menu.Item>
|
|
))}
|
|
</Menu>
|
|
);
|
|
|
|
return (
|
|
<Dropdown overlay={menu} disabled={disabled}>
|
|
<a
|
|
className="ant-dropdown-link"
|
|
href=" #"
|
|
onClick={(e) => e.preventDefault()}
|
|
>
|
|
<DownOutlined />
|
|
</a>
|
|
</Dropdown>
|
|
);
|
|
}
|
|
|
|
export default connect(mapStateToProps, null)(JobsDetailChangeFilehandler);
|