'use client' import { forwardRef, memo } from 'react' import { CancelSmallIcon } from '@channel.io/bezier-icons' import { isEmpty, isNil } from '~/src/utils/type' import { BaseTagBadge, BaseTagBadgeText } from '~/src/components/BaseTagBadge' import { Icon } from '~/src/components/Icon' import { type TagProps } from './Tag.types' import styles from './Tag.module.scss' /** * @deprecated */ const TAG_TEST_ID = 'bezier-tag' /** * @deprecated */ const TAG_DELETE_TEST_ID = 'bezier-tag-delete-icon' /** * `Tag` is a component for representing tag, which shows close icon when `onDelete` property is specified. * @example * ```tsx * * Payment * * ``` */ export const Tag = memo( forwardRef(function Tag( { size = 'm', variant = 'default', children, onDelete, ...rest }, forwardedRef ) { return ( {!isEmpty(children) && ( {children} )} {!isNil(onDelete) && ( { e.stopPropagation() onDelete(e) }} data-testid={TAG_DELETE_TEST_ID} /> )} ) }) )