-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathcommon.ts
More file actions
37 lines (33 loc) · 1.17 KB
/
common.ts
File metadata and controls
37 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { _FileUploadCardsStrings } from '../FileUploadCards';
/* @conditional-compile-remove(file-sharing) */
import { useLocale } from '../../localization';
import { ParticipantState } from '../../types';
/**
* Conditionally modify locale strings passed to the file card
* @returns file upload card strings
*/
export const useLocaleFileCardStringsTrampoline = (): _FileUploadCardsStrings => {
/* @conditional-compile-remove(file-sharing) */
return useLocale().strings.sendBox;
return {
removeFile: '',
uploadCompleted: '',
uploading: ''
};
};
/**
* Identify if a participant state if part of the Calling states or Hold states.
*/
export const _isParticipantStateCallingOrHold = (participantState?: ParticipantState): boolean => {
return !!participantState && ['Idle', 'Connecting', 'EarlyMedia', 'Ringing', 'Hold'].includes(participantState);
};
/**
* @private
* Generate a unique id
* TODO: Replace with useId() once React 18 becomes a required dependency.
*/
export const generateUniqueId = (): string => {
return 'acr-' + Math.floor(Math.random() * Date.now()).toString(16);
};