(thread: RawThreadInfo | ThreadInfo)
| 10 | import { useSelector } from '../utils/redux-utils.js'; |
| 11 | |
| 12 | function useAvatarForThread(thread: RawThreadInfo | ThreadInfo): ClientAvatar { |
| 13 | const { containingThreadID } = thread; |
| 14 | const containingThreadInfo = useSelector(state => |
| 15 | containingThreadID ? threadInfoSelector(state)[containingThreadID] : null, |
| 16 | ); |
| 17 | return getAvatarForThread(thread, containingThreadInfo); |
| 18 | } |
| 19 | |
| 20 | export { useAvatarForThread }; |
no test coverage detected