{"version":3,"sources":["../../../../../src/components/notification-item/parts/Avatar.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemAvatarProps = { className?: string };\n\nexport const Avatar = ({ className }: NotificationItemAvatarProps) => {\n  const { notification, renderers } = useNotificationItem('Avatar');\n  const style = useStyle();\n\n  if (renderers.renderAvatar) {\n    return <>{renderers.renderAvatar(notification)}</>;\n  }\n\n  if (!notification.avatar) {\n    return (\n      <div\n        className={style({\n          key: notificationItemStyles.avatarFallback.key,\n          className: [notificationItemStyles.avatarFallback.className, className].filter(Boolean).join(' '),\n          context: { notification },\n        })}\n      />\n    );\n  }\n\n  return (\n    <img\n      alt=\"\"\n      className={style({\n        key: notificationItemStyles.avatar.key,\n        className: [notificationItemStyles.avatar.className, className].filter(Boolean).join(' '),\n        context: { notification },\n      })}\n      src={notification.avatar}\n    />\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,qBAAoC;AASzB;AALJ,IAAM,SAAS,CAAC,EAAE,UAAU,MAAmC;AACpE,QAAM,EAAE,cAAc,UAAU,QAAI,oCAAoB,QAAQ;AAChE,QAAM,YAAQ,iCAAS;AAEvB,MAAI,UAAU,cAAc;AAC1B,WAAO,2EAAG,oBAAU,aAAa,YAAY,GAAE;AAAA,EACjD;AAEA,MAAI,CAAC,aAAa,QAAQ;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,MAAM;AAAA,UACf,KAAK,sCAAuB,eAAe;AAAA,UAC3C,WAAW,CAAC,sCAAuB,eAAe,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,UAChG,SAAS,EAAE,aAAa;AAAA,QAC1B,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,OAAO;AAAA,QACnC,WAAW,CAAC,sCAAuB,OAAO,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACxF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MACD,KAAK,aAAa;AAAA;AAAA,EACpB;AAEJ;","names":[]}