import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple"];import"./UserSelectItem.css";import{IconCheck}from"@consta/icons/IconCheck";import React,{forwardRef,useRef}from"react";import{Transition}from"react-transition-group";import{Avatar}from"../../Avatar";import{mapHorisontalSpase,mapHorisontalSpaseIncreased,mapItemVerticalPadding}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cnCanary}from"../../../utils/bem";export var cnUserSelectItem=cnCanary("UserSelectItem");export var UserSelectItem=forwardRef(function(a,b){var c=a.className,d=a.label,e=a.subLabel,f=a.avatarUrl,g=a.active,h=a.hovered,i=a.size,j=a.indent,k=a.disable,l=a.multiple,m=_objectWithoutProperties(a,_excluded),n=useRef(null);return React.createElement("div",Object.assign({},m,{className:cnUserSelectItem({active:g,hovered:h,size:i,indent:j,disable:k},[cnMixSpace({pH:"increased"===j?mapHorisontalSpaseIncreased[i]:mapHorisontalSpase[i],pV:mapItemVerticalPadding[i]}),c]),"aria-selected":g,ref:b}),React.createElement("div",{className:cnUserSelectItem("AvatarContainer")},React.createElement(Avatar,{className:cnUserSelectItem("Avatar"),url:f,name:d}),l&&React.createElement(Transition,{in:g,unmountOnExit:!0,timeout:200,nodeRef:n},function(a){return React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon",{animate:a}),ref:n})}),!l&&g&&React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon")})),e?React.createElement("div",{className:cnUserSelectItem("Info")},React.createElement("div",null,d),React.createElement("div",{className:cnUserSelectItem("SubLabel",{disable:k})},e)):React.createElement("div",{className:cnUserSelectItem("Info")},d))});
//# sourceMappingURL=UserSelectItem.js.map