import React from 'react';
import { remote } from 'electron';
import { Button, Text } from '@blueprintjs/core';
import { useTranslation } from 'react-i18next';
import { TFunction } from 'i18next';
import { Col, Row } from 'react-flexbox-grid';
import DEVICES from '../../constants/test-devices.json';
import ScanQRStep from './ScanQRStep';
import ChooseAppOrScreeenStep from './ChooseAppOrScreeenStep';
import ConfirmStep from './ConfirmStep';
import ConnectedDevicesService from '../../features/ConnectedDevicesService';
import SharingSessionService from '../../features/SharingSessionService';
const sharingSessionService = remote.getGlobal(
'sharingSessionService'
) as SharingSessionService;
const connectedDevicesService = remote.getGlobal(
'connectedDevicesService'
) as ConnectedDevicesService;
interface IntermediateStepProps {
activeStep: number;
steps: string[];
handleNext: () => void;
handleBack: () => void;
handleNextEntireScreen: () => void;
handleNextApplicationWindow: () => void;
resetPendingConnectionDevice: () => void;
resetUserAllowedConnection: () => void;
}
function getStepContent(
t: TFunction,
stepIndex: number,
handleNextEntireScreen: () => void,
handleNextApplicationWindow: () => void,
pendingConnectionDevice: Device | null
) {
switch (stepIndex) {
case 0:
return ;
case 1:
return (
<>
{t('Choose Entire Screen or App window you want to share')}
>
);
case 2:
return ;
default:
return 'Unknown stepIndex';
}
}
function isConfirmStep(activeStep: number, steps: string[]) {
return activeStep === steps.length - 1;
}
export default function IntermediateStep(props: IntermediateStepProps) {
const { t } = useTranslation();
const {
activeStep,
steps,
handleNext,
handleBack,
handleNextEntireScreen,
handleNextApplicationWindow,
resetPendingConnectionDevice,
resetUserAllowedConnection,
} = props;
const connectDevice = (device: Device) => {
connectedDevicesService.setPendingConnectionDevice(device);
};
return (
{getStepContent(
t,
activeStep,
handleNextEntireScreen,
handleNextApplicationWindow,
connectedDevicesService.pendingConnectionDevice
)}
{
// eslint-disable-next-line no-nested-ternary
process.env.NODE_ENV === 'production' &&
process.env.RUN_MODE !== 'dev' &&
process.env.RUN_MODE !== 'test' ? (
<>>
) : activeStep === 0 ? (
// eslint-disable-next-line react/jsx-indent
) : (
<>>
)
// activeStep === 0 ? (
//
// ) : (
// <>>
// )
}
{
/**/
activeStep !== 0 ? (
) : (
<>>
)
}
);
}