<template>
  <SingleProfile
    v-if="!isGroup"
    :userInfo="inviteData?.participant?.userInfo"
    :isVideo="isVideo"
    :isWaiting="isWaiting"
    :isRecv="isRecv"
  />
  <GroupProfile v-else :inviteData="inviteData" :isWaiting="isWaiting" :room="room" />
</template>

<script lang="ts" setup>
import { Room } from 'livekit-client'
import { InviteData } from '../data'

import SingleProfile from './SingleProfile.vue'
import GroupProfile from './GroupProfile.vue'
import useInviteData from '../useInviteData'

type RtcProfileProps = {
  room: Room
  inviteData: InviteData
  isWaiting: boolean
}
const props = defineProps<RtcProfileProps>()

const { isVideo, isGroup, isRecv } = useInviteData(props.inviteData)
</script>
