Sha256: 72f7b24bd313f8ea7b1b15e207bfbb41c709d557cb9e15dad058c1fce6b08599

Contents?: true

Size: 876 Bytes

Versions: 231

Compression:

Stored size: 876 Bytes

Contents

/* @flow */

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

import User from '../../pb_user/_user'

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

231 entries across 231 versions & 1 rubygems

Version Path
playbook_ui-12.19.0.pre.alpha.PLAY699zindexresponsive650 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.19.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown638 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.19.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown629 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown628 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements627 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown626 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY735mobileheadersfix616 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements613 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0.pre.alpha.PLAY747carddarktokens610 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.18.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.17.1 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.17.0.pre.alpha.lightboxcurrentPhotoIndex582 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.17.0 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.16.0.pre.alpha.tooltippositionprop566 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg558 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg547 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg532 app/pb_kits/playbook/pb_typeahead/components/Option.jsx
playbook_ui-12.16.0.pre.alpha.lightboxcurrentphotoprop531 app/pb_kits/playbook/pb_typeahead/components/Option.jsx