@trellixio/roaster-coffee
Version:
Beans' product component library
13 lines (12 loc) • 598 B
JavaScript
import * as React from 'react';
import { classNames } from '@/utils';
import { TagGroup } from './TagGroup';
import { ButtonIcon } from '../ButtonIcon';
export const Tag = React.forwardRef(({ children, onRemove, color = 'grey', className }, ref) => {
return (React.createElement("em", { ref: ref, className: classNames('tag', color, className) },
children,
onRemove && (React.createElement(ButtonIcon, { variant: "close-tag", onClick: onRemove },
React.createElement("i", { className: "fa-regular fa-xmark" })))));
});
Tag.displayName = 'Tag';
Tag.Group = TagGroup;