import { ExcalidrawApp } from '@jitsi/excalidraw'; import i18next from 'i18next'; import React, { useCallback, useRef } from 'react'; import { WHITEBOARD_UI_OPTIONS } from '../../constants'; /** * Whiteboard wrapper for mobile. * * @returns {JSX.Element} */ const WhiteboardWrapper = ({ className, collabDetails, collabServerUrl, localParticipantName }: { className?: string; collabDetails: { roomId: string; roomKey: string; }; collabServerUrl: string; localParticipantName: string; }) => { const excalidrawRef = useRef(null); const excalidrawAPIRef = useRef(null); const collabAPIRef = useRef(null); const getExcalidrawAPI = useCallback(excalidrawAPI => { if (excalidrawAPIRef.current) { return; } excalidrawAPIRef.current = excalidrawAPI; }, []); const getCollabAPI = useCallback(collabAPI => { if (collabAPIRef.current) { return; } collabAPIRef.current = collabAPI; collabAPIRef.current.setUsername(localParticipantName); }, [ localParticipantName ]); return (
); }; export default WhiteboardWrapper;