Added parts returning as a part of BOD-19

This commit is contained in:
Patrick Fic
2020-05-14 15:46:48 -07:00
parent cc47fd698a
commit 87146fa08d
34 changed files with 816 additions and 184 deletions

View File

@@ -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>
))