Added parts returning as a part of BOD-19
This commit is contained in:
@@ -4,7 +4,13 @@ const { Option } = Select;
|
||||
|
||||
//To be used as a form element only.
|
||||
|
||||
const VendorSearchSelect = ({ value, onChange, options, onSelect }) => {
|
||||
const VendorSearchSelect = ({
|
||||
value,
|
||||
onChange,
|
||||
options,
|
||||
onSelect,
|
||||
disabled,
|
||||
}) => {
|
||||
const [option, setOption] = useState(value);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -21,15 +27,15 @@ const VendorSearchSelect = ({ value, onChange, options, onSelect }) => {
|
||||
width: 300,
|
||||
}}
|
||||
onChange={setOption}
|
||||
optionFilterProp="name"
|
||||
optionFilterProp='name'
|
||||
onSelect={onSelect}
|
||||
>
|
||||
disabled={disabled || false}>
|
||||
{options
|
||||
? options.map((o) => (
|
||||
<Option key={o.id} value={o.id} name={o.name} discount={o.discount}>
|
||||
<div style={{ display: "flex" }}>
|
||||
{o.name}
|
||||
<Tag color="green">{`${o.discount * 100}%`}</Tag>
|
||||
<Tag color='green'>{`${o.discount * 100}%`}</Tag>
|
||||
</div>
|
||||
</Option>
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user