import React, { useCallback, useState } from 'react';
import PropTypes from 'prop-types';
import { submitQRHardwareSignature } from '../../../../store/actions';
import Player from './player';
import Reader from './reader';
const QRHardwareSignRequest = ({ request, handleCancel, setErrorTitle }) => {
const [status, setStatus] = useState('play');
const toRead = useCallback(() => setStatus('read'), []);
const renderPlayer = () => {
const { payload } = request;
return (
);
};
const renderReader = () => {
return (
);
};
if (status === 'play') {
return renderPlayer();
}
return renderReader();
};
QRHardwareSignRequest.propTypes = {
request: PropTypes.object.isRequired,
handleCancel: PropTypes.func.isRequired,
setErrorTitle: PropTypes.func.isRequired,
};
export default QRHardwareSignRequest;