Sha256: c6c5067bcb6e09cd445a9bfd8985fd06cad8f7e9876c9cdede56c97d40b14436

Contents?: true

Size: 870 Bytes

Versions: 90

Compression:

Stored size: 870 Bytes

Contents

/* @flow */

import React from 'react'
import { components } from 'react-select'

import {
  User,
} from '../../'

const Option = (props: any) => {
  const {
    imageUrl,
  } = props.data
  const { valueComponent } = props.selectProps

  return (
    <components.Option {...props}>
      <div>
        <Choose>
          <When condition={!valueComponent && imageUrl}>
            <User
                align="left"
                avatarUrl={imageUrl}
                dark={props.selectProps.dark}
                name={props.label}
                orientation="horizontal"
            />
          </When>
          <When condition={valueComponent}>
            { valueComponent(props.data) }
          </When>
          <Otherwise>
            {props.label}
          </Otherwise>
        </Choose>
      </div>
    </components.Option>
  )
}

export default Option

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
playbook_ui-7.16.0.pre.alpha5 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.16.0.pre.alpha4 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.16.0.pre.alpha3 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.16.0.pre.alpha2 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.16.0.pre.alpha1 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.16.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.15.1 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.15.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-7.14.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx