import { TUser } from "../../type/user-type";

export interface IMiroTalkSFUProps {
  user: TUser | null
}

export function MiroTalkSFU({user}: IMiroTalkSFUProps) {

  const name = `${user?.firstname} ${user?.lastname}`;
  const room = user?.username;

  return (
    <>
      {user && (
        <iframe
          title="Video Conference" 
          allow="camera; microphone; display-capture; fullscreen; clipboard-read; clipboard-write; autoplay" 
          src = {`https://live.tniglobal.org/join?room=${room}&roomPassword=0&name=${name}&audio=true&video=false&notify=0`}
          style={{ height: '550px', width: '100%', border: '0px' }}
        />
      )}
      
    </>
  );
}