{"version":3,"file":"useCooldownRemaining.mjs","names":[],"sources":["../../../../../src/components/MessageComposer/hooks/useCooldownRemaining.tsx"],"sourcesContent":["import { type CooldownTimerState } from 'stream-chat';\n\nimport { useChannel } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst cooldownTimerStateSelector = (state: CooldownTimerState) => ({\n  cooldownRemaining: state.cooldownRemaining,\n});\n\n/**\n * Seconds left in the channel's slow-mode cooldown.\n *\n * @returns Seconds remaining, or 0 when no cooldown is running.\n */\nexport const useCooldownRemaining = (): number => {\n  const channel = useChannel();\n  return (\n    useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector)\n      .cooldownRemaining ?? 0\n  );\n};\n"],"mappings":";;;;AAKA,IAAM,8BAA8B,WAA+B,EACjE,mBAAmB,MAAM,kBAC3B;;;;;;AAOA,IAAa,6BAAqC;CAEhD,OACE,cAFc,WAEA,CAAA,CAAQ,cAAc,OAAO,0BAA0B,CAAC,CACnE,qBAAqB;AAE5B"}