BOD-61 Fixed invoice enter modal to simplify + follow new modal pattern.
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user