-
Notifications
You must be signed in to change notification settings - Fork 365
Expand file tree
/
Copy pathRCInstance.js
More file actions
29 lines (25 loc) · 853 Bytes
/
RCInstance.js
File metadata and controls
29 lines (25 loc) · 853 Bytes
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
import { createContext, useContext } from 'react';
const RCContext = createContext();
export const RCInstanceProvider = RCContext.Provider;
/**
* @typedef {Object} ECOptions
* @property {boolean} enableThreads
* @property {string} authFlow
* @property {string} width
* @property {string} height
* @property {string} host
* @property {string} roomId
* @property {string} channelName
* @property {boolean} showRoles
* @property {boolean} showAvatar
* @property {boolean} hideHeader
* @property {boolean} anonymousMode
*
* @typedef {Object} RCContext
* @property {import('@embeddedchat/api').EmbeddedChatApi} RCInstance
* @property {ECOptions} ECOptions
* @property {import('@embeddedchat/api').IAIAdapter | null} aiAdapter
* @returns {RCContext}
*/
export const useRCContext = () => useContext(RCContext);
export default RCContext;