import { HeartOutlined } from "@ant-design/icons"; import { Select, Space, Tag } from "antd"; import React, { forwardRef, useEffect, useState } from "react"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; const { Option } = Select; // To be used as a form element only. const VendorSearchSelect = ({ value, onChange, options, onSelect, disabled, preferredMake, showPhone }, ref) => { const [option, setOption] = useState(value); useEffect(() => { if (value !== option && onChange) { onChange(option); } }, [value, option, onChange]); const favorites = preferredMake && options ? options.filter((o) => o.favorite.filter((f) => f.toLowerCase() === preferredMake.toLowerCase()).length > 0) : []; return ( ); }; export default forwardRef(VendorSearchSelect);