Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ContactPicker = props => {
const { placeholder, onChange, value, ...rest } = props
const [showContactsList, setShowContactsList] = useState(false)
const handleChange = contact => {
onChange(contact)
}
return (
<>
setShowContactsList(true)}>
{value ? Contact.getDisplayName(value) : placeholder}
{showContactsList && (
setShowContactsList(false)}
onItemClick={handleChange}
/>
)}
)
}
return contacts.filter(contact => {
const displayName = Contact.getDisplayName(contact)
if (!displayName) {
return false
}
return displayName.toLowerCase().includes(f)
})
}