RetryBtn.js 721 Bytes
import React from 'react'
import { useSetRecoilState } from 'recoil';
import { Link } from 'react-router-dom';
import "../style/Landing.css";
import { selectedPosState, analysisResultState } from '../store/Global';

const RetryBtn = (props) => {
    const setPosition = useSetRecoilState(selectedPosState);
    const setResult = useSetRecoilState(analysisResultState);
    const reset = () => {
        setPosition('front');
        setResult('loading');
    }
    return (
        <div className="mainBtnContainer">
            <Link to="/main">
                <button className="startBtn" onClick={reset}>{props.btnText}</button>
            </Link>
        </div>
    )
}
export default RetryBtn;