{"version":3,"file":"ChannelDetailListLoadingIndicator.mjs","names":[],"sources":["../../../../src/plugins/ChannelDetail/ChannelDetailListLoadingIndicator.tsx"],"sourcesContent":["import type { SearchSource, SearchSourceState } from 'stream-chat';\nimport { useStateStore } from '../../store';\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../../components/Loading';\nimport { useComponentContext } from '../../context';\n\nconst searchSourceFooterStateSelector = (state: SearchSourceState) => ({\n  hasNextPage: state.hasNext,\n  isLoading: state.isLoading,\n});\n\nexport type ChannelMembersViewListFooterProps<T> = {\n  searchSource: SearchSource<T>;\n};\n\nexport const ChannelDetailListLoadingIndicator = <T,>({\n  searchSource,\n}: ChannelMembersViewListFooterProps<T>) => {\n  const { LoadingIndicator = DefaultLoadingIndicator } = useComponentContext();\n  const { hasNextPage, isLoading } = useStateStore(\n    searchSource.state,\n    searchSourceFooterStateSelector,\n  );\n\n  if (!hasNextPage || !isLoading) return null;\n\n  return (\n    <div className='str-chat__loading-indicator-placeholder'>\n      {isLoading && <LoadingIndicator />}\n    </div>\n  );\n};\n"],"mappings":";;;;;AAKA,IAAM,mCAAmC,WAA8B;CACrE,aAAa,MAAM;CACnB,WAAW,MAAM;AACnB;AAMA,IAAa,qCAAyC,EACpD,mBAC0C;CAC1C,MAAM,EAAE,kBAAA,qBAAmB,qBAA4B,oBAAoB;CAC3E,MAAM,EAAE,aAAa,cAAc,cACjC,aAAa,OACb,+BACF;CAEA,IAAI,CAAC,eAAe,CAAC,WAAW,OAAO;CAEvC,OACE,oBAAC,OAAD;EAAK,WAAU;YACZ,aAAa,oBAAC,oBAAD,CAAmB,CAAA;CAC9B,CAAA;AAET"}