import { ComponentType } from 'react'
import { RoomInfo } from '@zocks-communications/client-sdk-js'
import { StyledComponent } from '../common'
import { JoinOptions } from '../../store'
import {
  JoinPageLocalStreamsProps,
  JoinPageRoomButtonsProps,
  JoinPageRoomInputProps,
  RoomJoinSelectOption,
} from './JoinPageComponents'

export interface JoinPageComponents {
  JoinPageLocalStreams?: ComponentType<JoinPageLocalStreamsProps>
  JoinPageHeader?: ComponentType<StyledComponent>
  JoinPageRoomInput?: ComponentType<JoinPageRoomInputProps>
  JoinPageRoomButtons?: ComponentType<JoinPageRoomButtonsProps>
}

export interface JoinPageProps extends StyledComponent {
  joinAction: (joinOptions: JoinOptions) => void
  createRoomAction?: () => Promise<RoomInfo>
  initialRoomJoinInputValue?: string
  initialRoomJoinSelectValue?: RoomJoinSelectOption
  newMeetingDisabled?: boolean
  videoEnabledByDefault?: boolean
  audioEnabledByDefault?: boolean
  onNewRoomCreated?: (roomInfo: RoomInfo) => void
  joinOptions?: Partial<JoinOptions>
  components?: JoinPageComponents
}
