import React from 'react'; import { HMSTranscriptionMode, selectIsTranscriptionEnabled, useHMSActions, useHMSStore } from '@100mslive/react-sdk'; import { AlertTriangleIcon, CrossIcon } from '@100mslive/react-icons'; import { Button } from '../../../Button'; import { Box, Flex } from '../../../Layout'; import { Loading } from '../../../Loading'; import { Text } from '../../../Text'; // @ts-ignore: No implicit Any import { ToastManager } from '../Toast/ToastManager'; // @ts-ignore: No implicit Any import { useSetAppDataByKey, useSetIsCaptionEnabled } from '../AppData/useUISettings'; import { CAPTION_TOAST } from '../../common/constants'; export const CaptionContent = ({ isMobile, onExit }: { isMobile: boolean; onExit: () => void }) => { const DURATION = 2000; const actions = useHMSActions(); const isTranscriptionEnabled = useHMSStore(selectIsTranscriptionEnabled); const [toastId, setToastId] = useSetAppDataByKey(CAPTION_TOAST.captionToast); const [isCaptionEnabled, setIsCaptionEnabled] = useSetIsCaptionEnabled(); return ( <> {isTranscriptionEnabled ? 'Disable' : 'Enable'} Closed Caption (CC) for this session? {!isMobile ? ( This will {isTranscriptionEnabled ? 'disable' : 'enable'} Closed Captions for everyone in this room. You can  {isTranscriptionEnabled ? 'enable' : 'disable'} it later. ) : null} {isMobile ? null : ( )} {isMobile && isTranscriptionEnabled ? ( ) : null} {isMobile && ( This will {isTranscriptionEnabled ? 'disable' : 'enable'} Closed Captions for everyone in this room. You can  {isTranscriptionEnabled ? 'enable' : 'disable'} it later. )} ); };