Sha256: b682d6801ec8df493cee7b6f83cb6fdc2a036a29dbb9b572874f9476e5c033d4
Contents?: true
Size: 1.38 KB
Versions: 14
Compression:
Stored size: 1.38 KB
Contents
/* @flow */ import React from 'react' import { components } from 'react-select' import { Badge, 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 { multiKit } = props.selectProps const formPillProps = { marginRight: 'xs', name: label, } if (typeof imageUrl === 'string') formPillProps.avatarUrl = imageUrl return ( <components.MultiValueContainer className="text_input_multivalue_container" {...props} > <If condition={multiKit === 'badge'}> <Badge closeProps={removeProps} removeIcon text={label} variant="primary" /> <Else /> <If condition={imageUrl}> <FormPill avatarUrl={imageUrl} closeProps={removeProps} marginRight="xs" name={label} size={multiKit === 'smallPill' ? 'small' : ''} /> <Else /> <FormPill closeProps={removeProps} marginRight="xs" size={multiKit === 'smallPill' ? 'small' : ''} text={label} /> </If> </If> </components.MultiValueContainer> ) } export default MultiValue
Version data entries
14 entries across 14 versions & 1 rubygems