import React , { createContext , useContext } from 'react' ; import { CameraButtonStrings , EndCallButtonStrings , ErrorBarStrings , MessageStatusIndicatorStrings , MessageThreadStrings , MicrophoneButtonStrings , DevicesButtonStrings , ParticipantsButtonStrings , ParticipantItemStrings , ScreenShareButtonStrings , SendBoxStrings , TypingIndicatorStrings , VideoGalleryStrings } from '../components' ; import { COMPONENT_LOCALE_EN_US } from './locales' ; public export interface ComponentLocale { /** Strings for components */ strings : ComponentStrings ; } public export interface ComponentStrings { /** Strings for MessageThread */ messageThread : MessageThreadStrings ; /** Strings for ParticipantItem */ participantItem : ParticipantItemStrings ; /** Strings for CameraButton */ cameraButton : CameraButtonStrings ; /** Strings for MicrophoneButton */ microphoneButton : MicrophoneButtonStrings ; /** Strings for EndCallButton */ endCallButton : EndCallButtonStrings ; /** Strings for DevicesButton */ devicesButton : DevicesButtonStrings ; /** Strings for ParticipantsButton */ participantsButton : ParticipantsButtonStrings ; /** Strings for ScreenShareButton */ screenShareButton : ScreenShareButtonStrings ; /** Strings for TypingIndicator */ typingIndicator : TypingIndicatorStrings ; /** Strings for SendBox */ sendBox : SendBoxStrings ; /** Strings for MessageStatusIndicator */ messageStatusIndicator : MessageStatusIndicatorStrings ; /** Strings for ErroBar */ errorBar : ErrorBarStrings ; /** Strings for VideoGallery */ videoGallery : VideoGalleryStrings ; } public export const LocaleContext = createContext < ComponentLocale > ( COMPONENT_LOCALE_EN_US ) ; /**
 * Props for  LocalizationProvider .
 *
 *  public export type LocalizationProviderProps = { /** Locale context to provide components */ locale : ComponentLocale ; /** Children to provide locale context. */ children : React . ReactNode ; } ; remarks public export const LocalizationProvider = ( props ) : JSX . Element => { const { locale , children } = props ; return < LocaleContext . Provider value = { locale } > { children } < /LocaleContext.Provider>; } ; /** React hook to access locale */ export const useLocale = ( ) : ComponentLocale => useContext ( LocaleContext ) ;