import { useState } from 'react'; function CodeDisplay({ code, isConnected, onCreateRoom, onJoinRoom, joinCode, setJoinCode }) { //const [showCode, setShowCode] = useState(true); const handleJoin = () => { if (joinCode) { //const trimCode=(joinCode.charAt(joinCode.length-1)==" ")?joinCode.substr(0,joinCode.length-1):joinCode; const trimCode = joinCode.trim(); onJoinRoom(trimCode); } }; const handleKeyJoin = (e) => { if (e.key === 'Enter') { handleJoin(); } }; return (
Code: {code}
{/*)}*/} > )}