import React from 'react'; import { INDEXES } from 'App/constants/zindex'; import { connect } from 'react-redux'; import { Button, Loader, Icon } from 'UI'; import { initiateCallEnd, releaseRemoteControl } from 'Player'; interface Props { userDisplayName: string; type: WindowType; } export enum WindowType { Call, Control, } const WIN_VARIANTS = { [WindowType.Call]: { text: 'to accept the call', icon: 'call' as const, action: initiateCallEnd, }, [WindowType.Control]: { text: 'to accept remote control request', icon: 'remote-control' as const, action: releaseRemoteControl, }, }; function RequestingWindow({ userDisplayName, type }: Props) { return (
Waiting for {userDisplayName}
{WIN_VARIANTS[type].text}
); } export default connect((state) => ({ userDisplayName: state.getIn(['sessions', 'current', 'userDisplayName']), }))(RequestingWindow);