Sha256: b0d84875a97400d6652664a19552135503ee5331b802440cdf4188a8054d706c
Contents?: true
Size: 898 Bytes
Versions: 25
Compression:
Stored size: 898 Bytes
Contents
/* @flow */ import React from 'react' import { components } from 'react-select' import { User, } from '../../' const Option = (props: any) => { const { imageUrl, label, } = props.data const handleOptionClicked = () => { const resultSelectedEvent = new CustomEvent('pb-typeahead-kit-result-option-select', { detail: props.data }) document.dispatchEvent(resultSelectedEvent) } return ( <components.Option {...props}> <div onClick={handleOptionClicked}> <Choose> <When condition={imageUrl}> <User align="left" avatarUrl={imageUrl} name={label} orientation="horizontal" /> </When> <When condition={!imageUrl}> {label} </When> </Choose> </div> </components.Option> ) } export default Option
Version data entries
25 entries across 25 versions & 1 rubygems