mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
Feature: Typing Indicator on widget and dashboard (#811)
* Adds typing indicator for widget * typing indicator for agents in dashboard Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
fabc3170b7
commit
5bc8219db5
@@ -9,3 +9,20 @@ export default () => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const getTypingUsersText = (users = []) => {
|
||||
const count = users.length;
|
||||
if (count === 1) {
|
||||
const [user] = users;
|
||||
return `${user.name} is typing`;
|
||||
}
|
||||
|
||||
if (count === 2) {
|
||||
const [first, second] = users;
|
||||
return `${first.name} and ${second.name} are typing`;
|
||||
}
|
||||
|
||||
const [user] = users;
|
||||
const rest = users.length - 1;
|
||||
return `${user.name} and ${rest} others are typing`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user