{"version":3,"file":"useMessagePaginator.mjs","names":[],"sources":["../../../src/hooks/useMessagePaginator.ts"],"sourcesContent":["import type { MessagePaginator } from 'stream-chat';\nimport { useChannel } from '../context';\nimport { useThreadContext } from '../components';\n\n/**\n * Returns the message paginator of the thread when inside one, otherwise of the channel. Must be\n * used within a `Channel` or `Thread` subtree.\n */\nexport const useMessagePaginator = (): MessagePaginator => {\n  const channel = useChannel();\n  const thread = useThreadContext();\n\n  return thread?.messagePaginator ?? channel.messagePaginator;\n};\n"],"mappings":";;;;;;;AAQA,IAAa,4BAA8C;CACzD,MAAM,UAAU,WAAW;CAG3B,OAFe,iBAER,CAAA,EAAQ,oBAAoB,QAAQ;AAC7C"}