{"version":3,"sources":["../../../../../src/components/notification-item/parts/Dot.tsx"],"sourcesContent":["import { notificationItemStyles } from '@novu/js/ui-core';\nimport React from 'react';\nimport { useStyle } from '../../../hooks/internal/useEngineStores';\nimport { usePresence } from '../../../hooks/internal/usePresence';\nimport { useNotificationItem } from '../context';\n\nexport type NotificationItemDotProps = { className?: string };\n\n/** The unread marker on the right edge of the item. It scales out when the item is read and back in when unread. */\nexport const Dot = ({ className }: NotificationItemDotProps) => {\n  const { notification } = useNotificationItem('Dot');\n  const style = useStyle();\n  const dot = usePresence<HTMLSpanElement>(!notification.isRead, { appear: false });\n\n  return (\n    <div className={notificationItemStyles.dotContainer.className}>\n      {dot.isMounted && (\n        <span\n          ref={dot.ref}\n          className={style({\n            key: notificationItemStyles.dot.key,\n            className: [notificationItemStyles.dot.className, className].filter(Boolean).join(' '),\n            context: { notification },\n          })}\n          data-state={dot.state}\n        />\n      )}\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AAEvC,6BAAyB;AACzB,yBAA4B;AAC5B,qBAAoC;AAa5B;AARD,IAAM,MAAM,CAAC,EAAE,UAAU,MAAgC;AAC9D,QAAM,EAAE,aAAa,QAAI,oCAAoB,KAAK;AAClD,QAAM,YAAQ,iCAAS;AACvB,QAAM,UAAM,gCAA6B,CAAC,aAAa,QAAQ,EAAE,QAAQ,MAAM,CAAC;AAEhF,SACE,4CAAC,SAAI,WAAW,sCAAuB,aAAa,WACjD,cAAI,aACH;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,IAAI;AAAA,MACT,WAAW,MAAM;AAAA,QACf,KAAK,sCAAuB,IAAI;AAAA,QAChC,WAAW,CAAC,sCAAuB,IAAI,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,QACrF,SAAS,EAAE,aAAa;AAAA,MAC1B,CAAC;AAAA,MACD,cAAY,IAAI;AAAA;AAAA,EAClB,GAEJ;AAEJ;","names":[]}