import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { HiddenInput, StyledTag, Wrapper } from './styles';
/**
 * Тег с возможностью быть checked (по логике Checkbox)
 * @example
 * <CheckableTag
 * label="tag"
 * variant="contained"
 * color="success"
 * checked
 * onChange={handleChecked}
 * endAddon={(props: TagBadgeProps) => (<TagBadge {...props} badgeContent={'12'} />)}
 * />
 * @deprecated Используйте компонент Chip
 */
export const CheckableTag = forwardRef(({ checked, variant = 'light', color = 'grey', onChange, disabled, startAddon: StartAddon, endAddon: EndAddon, ...tagProps }, ref) => {
    const checkableStartAddon = StartAddon
        ? (props) => (_jsx(StartAddon, { checked: checked, disabled: disabled, ...props }))
        : undefined;
    const checkableEndAddon = EndAddon
        ? (props) => (_jsx(EndAddon, { checked: checked, disabled: disabled, ...props }))
        : undefined;
    return (_jsxs(Wrapper, { children: [_jsx(HiddenInput, { type: "checkbox", ref: ref, checked: checked, onChange: onChange, disabled: disabled }), _jsx(StyledTag, { variant: variant, color: color, disabled: disabled, startAddon: checkableStartAddon, endAddon: checkableEndAddon, "$isChecked": checked, ...tagProps })] }));
});
