useChannelDetailsMemberStatusText
A hook that resolves the localized subtitle status line shown under the channel title in ChannelDetails. For direct chats it returns Online when the other member is online (otherwise an empty string); for group chats it returns a {{memberCount}} members, {{onlineCount}} online summary.
Best Practices
- Use it to render the channel subtitle instead of recomputing member/online counts yourself.
- Pass an already-initialized channel so member and presence state are available.
- Customize the wording through the
Onlineand{{memberCount}} members, {{onlineCount}} onlinetranslation keys rather than post-processing the string. - Treat the returned string as derived UI state.
- Expect an empty string for direct chats where the other member is offline, and handle that in your layout.
Parameters
| Parameter | Description | Type |
|---|---|---|
channel | The channel whose member status line should be built. | Channel |
Return type
Returns a localized string describing the channel's member/presence status.
| Type |
|---|
string |