feat: add separate typing indicator

This commit is contained in:
Shivam Mishra
2025-03-17 17:03:37 +05:30
parent 2759954897
commit 9aee8d1a1f
4 changed files with 63 additions and 77 deletions
@@ -25,24 +25,6 @@ export const isJSONValid = value => {
return true;
};
export const getTypingUsersText = (users = []) => {
const count = users.length;
const [firstUser, secondUser] = users;
if (count === 1) {
return ['TYPING.ONE', { user: firstUser.name }];
}
if (count === 2) {
return [
'TYPING.TWO',
{ user: firstUser.name, secondUser: secondUser.name },
];
}
return ['TYPING.MULTIPLE', { user: firstUser.name, count: count - 1 }];
};
export const createPendingMessage = data => {
const timestamp = Math.floor(new Date().getTime() / 1000);
const tempMessageId = getUuid();