import React, { memo } from 'react';
import "./style.css";
import Timer from "../TransistionTimer";
import { BiRightArrowCircle, RiRecordCircleLine } from 'react-icons/all';

var SingleResult = function SingleResult(props) {
  var _props$exercise, _props$exercise$label, _props$exercise2, _props$exercise2$labe;

  // const resultExercise = props.resultsExercises.find(
  //   (exer) => exer._id === props.exercise._id
  // );
  var setIsRepetingExercise = props.setIsRepetingExercise;
  var resultExercise = props.resultExerciseValidation;
  return (resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.result) >= (resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.minAcceptableAngle) && (resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.result) <= (resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.acceptableAngle) ? /*#__PURE__*/React.createElement("div", {
    className: "single-result"
  }, /*#__PURE__*/React.createElement("div", {
    className: "single-result-container"
  }, /*#__PURE__*/React.createElement("h2", {
    className: "result-subtitle"
  }, "COMPLETED"), /*#__PURE__*/React.createElement("h1", {
    className: "result-title"
  }, (_props$exercise = props.exercise) === null || _props$exercise === void 0 ? void 0 : (_props$exercise$label = _props$exercise.label) === null || _props$exercise$label === void 0 ? void 0 : _props$exercise$label.toUpperCase(), ' ', /*#__PURE__*/React.createElement("span", {
    className: "result-number"
  }, resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.result))), /*#__PURE__*/React.createElement(Timer, {
    isPaused: props.isPaused,
    onTimerCountDownFinish: props.onNextTransition
  })) : /*#__PURE__*/React.createElement("div", {
    className: "single-result"
  }, /*#__PURE__*/React.createElement("div", {
    className: "single-result-container"
  }, /*#__PURE__*/React.createElement("h2", {
    className: "result-subtitle invalid"
  }, "Something may have gone wrong, or you may have a mobility limitation."), /*#__PURE__*/React.createElement("h1", {
    className: "result-title invalid"
  }, (_props$exercise2 = props.exercise) === null || _props$exercise2 === void 0 ? void 0 : (_props$exercise2$labe = _props$exercise2.label) === null || _props$exercise2$labe === void 0 ? void 0 : _props$exercise2$labe.toUpperCase(), ' ', /*#__PURE__*/React.createElement("span", {
    className: "result-number"
  }, resultExercise === null || resultExercise === void 0 ? void 0 : resultExercise.result)), /*#__PURE__*/React.createElement("p", {
    className: "result-text"
  }, "Expected range of motion for this exercise is between", ' ', /*#__PURE__*/React.createElement("b", null, resultExercise.minAcceptableAngle), ' and ', /*#__PURE__*/React.createElement("b", null, resultExercise.acceptableAngle))), /*#__PURE__*/React.createElement("button", {
    className: "btn-delete-record btn-solid-red",
    onClick: function onClick() {
      props.onRepeatExercise(true);
    }
  }, "TRY AGAIN"), /*#__PURE__*/React.createElement("button", {
    className: "btn-submit-record btn-solid-green",
    onClick: function onClick() {
      props.onSavePhysicalAssessmentsMetrics();
      props.onSetIsRepetingExercise(false);
      props.onNextTransition();
    }
  }, "SUBMIT TO CONTINUE"));
};

export default memo(SingleResult);