import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { Colors } from '../../styles'; import { Icon } from '../../surface'; import * as React from 'react'; import { DeleteButton, ImgAvatar, LetterAvatar, StyledChip } from './styled-chip'; interface Props { children: React.ReactNode; style?: React.CSSProperties; type: 'checked' | 'deletable' | 'basic'; variant: 'outlined' | 'contained'; color: Colors; avatar?: { type: 'img' | 'text', color?: string; value: string, }; icon?: IconProp; onClick?: any; } const Chip = (props: Props) => { return( {props.icon && } {props.avatar && <> {props.avatar.type === 'img' && } {props.avatar.type === 'text' && {props.avatar.value} } } {props.children} {props.type === 'checked' && } {props.type === 'deletable' && } ) } Chip.defaultProps = { type: 'basic', variant: 'contained', color: 'primary' } export default Chip;