import React, { PropTypes } from 'react'; import classnames from 'classnames'; import { themr } from 'react-css-themr'; import { CHIP } from '../identifiers.js'; import InjectAvatar from '../avatar/Avatar.js'; const factory = (Avatar) => { const Chip = ({children, className, deletable, onDeleteClick, theme, ...other}) => { let hasAvatar = false; if (React.Children.count(children)) { const firstChild = children[0]; hasAvatar = firstChild && firstChild.type && firstChild.type === Avatar; } const classes = classnames(theme.chip, { [theme.deletable]: !!deletable, [theme.avatar]: !!hasAvatar }, className); return (