BOD-61 Fixed invoice enter modal to simplify + follow new modal pattern.

This commit is contained in:
Patrick Fic
2020-04-02 11:05:04 -07:00
parent b93bb293e9
commit 53a567d65f
6 changed files with 278 additions and 268 deletions

View File

@@ -0,0 +1,40 @@
import { Select } from "antd";
import React, { useEffect, useState } from "react";
const { Option } = Select;
//To be used as a form element only.
const JobSearchSelect = ({ value, onChange, options, onBlur }) => {
const [option, setOption] = useState(value);
useEffect(() => {
if (onChange) {
onChange(option);
}
}, [option, onChange]);
return (
<Select
showSearch
autoFocus
value={option}
style={{
width: 300
}}
onChange={setOption}
optionFilterProp="children"
onBlur={onBlur}
>
{options
? options.map(o => (
<Option key={o.id} value={o.id}>
{`${o.ro_number ? o.ro_number : o.est_number} | ${o.ownr_ln ||
""} ${o.ownr_fn || ""} | ${o.v_model_yr ||
""} ${o.v_make_desc || ""} ${o.v_model_desc || ""}`}
</Option>
))
: null}
</Select>
);
};
export default JobSearchSelect;