{"version":3,"file":"static/js/18224.324ddb8e.chunk.js","mappings":"oIAeA,MAEaA,EAASC,IAUD,IAVE,KACrBC,EAAI,SACJC,EAAQ,OACRC,EAAM,QACNC,EAAO,UACPC,EAAS,SACTC,EAAQ,MACRC,EAAK,IACLC,EAAG,UACHC,GACaT,EACb,MAAMU,EACJJ,IAAaL,EAAUA,EAdJ,IAcC,KAA+B,QAErD,OAAOE,GACLQ,EAAAA,EAAAA,KAAA,OACEC,IAAKT,EACLK,IAAKA,EACLC,UAAW,UAAUA,GAAwB,KAC7CI,MAAO,CACLC,MAAO,GAAGb,MACVc,OAAQ,GAAGd,MACXe,aAAwB,WAAVT,EAAqB,MAAQ,MAC3CU,UAAW,YAIfN,EAAAA,EAAAA,KAAA,OACEO,KAAK,MACL,aAAYV,EACZC,UAAW,UAAUA,GAAwB,KAC7CI,MAAO,CACLC,MAAO,GAAGb,MACVc,OAAQ,GAAGd,MACXkB,gBAAiBf,EACjBgB,MAAOf,EACPC,SAAUI,EACVM,aAAwB,WAAVT,EAAqB,MAAQ,OAC3CL,SAEDA,GAEJ,C","sources":["newcomponents/UI/Avatar/index.tsx"],"sourcesContent":["import { ReactElement } from 'react';\nimport './index.less';\n\ntype TAvatarProps = {\n  size?: number;\n  children?: ReactElement | string;\n  imgSrc?: string;\n  bgColor?: string;\n  textColor?: string;\n  fontSize?: string;\n  shape?: 'circle' | 'square';\n  alt?: string;\n  className?: string;\n};\n\nconst FONT_SIZE_COEF = 2.5;\n\nexport const Avatar = ({\n  size,\n  children,\n  imgSrc,\n  bgColor,\n  textColor,\n  fontSize,\n  shape,\n  alt,\n  className\n}: TAvatarProps) => {\n  const computedFontSize =\n    fontSize || (size ? `${size / FONT_SIZE_COEF}px` : '14px');\n\n  return imgSrc ? (\n    <img\n      src={imgSrc}\n      alt={alt}\n      className={`avatar ${className ? className : ''}`}\n      style={{\n        width: `${size}px`,\n        height: `${size}px`,\n        borderRadius: shape === 'circle' ? '50%' : '8px',\n        objectFit: 'cover'\n      }}\n    />\n  ) : (\n    <div\n      role=\"img\"\n      aria-label={alt}\n      className={`avatar ${className ? className : ''}`}\n      style={{\n        width: `${size}px`,\n        height: `${size}px`,\n        backgroundColor: bgColor,\n        color: textColor,\n        fontSize: computedFontSize,\n        borderRadius: shape === 'square' ? '8px' : '50%'\n      }}\n    >\n      {children}\n    </div>\n  );\n};\n"],"names":["Avatar","_ref","size","children","imgSrc","bgColor","textColor","fontSize","shape","alt","className","computedFontSize","_jsx","src","style","width","height","borderRadius","objectFit","role","backgroundColor","color"],"sourceRoot":""}