import type { ComponentPropsWithRef } from 'react' import styles from './Chip.module.css' export type ChipProps = Omit, 'children'> & { label: string // When set, the chip shows a "Remove {label}" button that calls it. onRemove?: () => void } export function Chip({ label, onRemove, className, ...rest }: ChipProps) { const classes = [styles.chip, onRemove && styles.removable, className].filter(Boolean).join(' ') return ( {label} {onRemove && ( )} ) }