Sha256: f07a2ed3fc14f4e7aedaa8d882f70400c243fcd6016f3a86a0efdea52f3a616e

Contents?: true

Size: 1003 Bytes

Versions: 66

Compression:

Stored size: 1003 Bytes

Contents

/* @flow */

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

import { FormPill } from '../../'

type Props = {
  data: object,
  multiValueTemplate: any,
  removeProps: any,
  selectProps: any,
}

const MultiValue = (props: Props) => {
  const { removeProps } = props
  const { imageUrl, label } = props.data

  const formPillProps = {
    marginRight: 'xs',
    name: label,
  }

  if (typeof imageUrl === 'string') formPillProps.avatarUrl = imageUrl

  return (
    <components.MultiValueContainer
        className="text_input_multivalue_container"
        {...props}
    >
      <If condition={imageUrl}>
        <FormPill
            avatarUrl={imageUrl}
            closeProps={removeProps}
            marginRight="xs"
            name={label}
        />
        <Else />
        <FormPill
            closeProps={removeProps}
            marginRight="xs"
            text={label}
        />
      </If>
    </components.MultiValueContainer>
  )
}

export default MultiValue

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
playbook_ui-9.12.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.9.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.8.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.7.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.6.1 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx