import { useMemo } from 'react';
import { classNames } from '../../utils/classNames';
import { tagClassnames } from '../constants';
export const useLogic = ({ onDelete, variant, disabled, size, className, }) => {
    const handleDelete = (event) => {
        event.stopPropagation();
        onDelete?.(event);
    };
    const classnames = useMemo(() => classNames(tagClassnames.root, {
        [tagClassnames.variantText]: variant === 'text',
        [tagClassnames.variantContained]: variant === 'contained',
        [tagClassnames.variantLight]: variant === 'light',
        [tagClassnames.sizeSmall]: size === 'small',
        [tagClassnames.sizeMedium]: size === 'medium',
        [tagClassnames.sizeLarge]: size === 'large',
        [tagClassnames.removable]: Boolean(onDelete),
        [tagClassnames.disabled]: disabled,
    }, className), [variant, size, onDelete, disabled, className]);
    return { handleDelete, classnames };
};
