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