@sendbird/uikit-utils
Version:
A collection of utility functions and constants for building chat UI components with Sendbird UIKit.
12 lines (9 loc) • 443 B
text/typescript
import type { SendbirdOpenChannel } from '../types';
export const getOpenChannelTitle = (channel: SendbirdOpenChannel, DEFAULT_CHANNEL_NAME = 'Open Channel') => {
const trimmedChannelName = channel.name.trim();
if (trimmedChannelName === '') return DEFAULT_CHANNEL_NAME;
return trimmedChannelName;
};
export const getOpenChannelParticipants = (channel: SendbirdOpenChannel) => {
return `${channel.participantCount} participants`;
};