import React, { useRef } from 'react' import { Button, FormControl, FormGroup, FormSelect } from 'react-bootstrap' import { useAppSelector } from '@/app/hooks' export const SendDataChannelMessagingMessage: React.FC = () => { const selectRef = useRef(null) const textareaRef = useRef(null) const sora = useAppSelector((state) => state.soraContents.sora) const datachannels = useAppSelector((state) => state.soraContents.datachannels) const handleSendMessage = (): void => { if (selectRef.current === null || textareaRef.current === null) { return } const label = selectRef.current.value if (sora) { sora.sendMessage(label, new TextEncoder().encode(textareaRef.current.value)) } } return ( <>
{datachannels.map((datachannel) => { return ( ) })}
{0 < datachannels.length ? (
          {JSON.stringify(datachannels, null, 2)}
        
) : null} ) }