{"size": 818, "ext": "js", "max_stars_repo_path": "src/javascript/components/shared/successPopup.js", "max_stars_repo_name": "visha12l/React_Quiz_APP", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/javascript/components/shared/successPopup.js", "max_issues_repo_name": "visha12l/React_Quiz_APP", "max_issues_repo_issues_event_min_datetime": "2021-06-28T20:28:48.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T01:59:08.000Z", "max_forks_repo_path": "src/javascript/components/shared/successPopup.js", "max_forks_repo_name": "visha12l/React_Quiz_APP", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 24.7878787879, "max_line_length": 72, "alphanum_fraction": 0.597799511}
import React from "react";
import { func } from "prop-types";

const SuccessPopup = ({ totalQuestion, result, closePopup }) => {
  const { attempted, studentMarks } = result;
  return (
    <div className="successPopupWrap">
      <div className="content">
        <h2>Result</h2>
        <span>total Attempted => {attempted}</span>
        <span>Correct answer => {studentMarks} </span>
        <span>InCorrect answers => {totalQuestion - studentMarks}</span>
        <span>
          Total Marks => {studentMarks} / {totalQuestion}
        </span>
        <button className="submitBtn" onClick={() => closePopup()}>
          OK
        </button>
      </div>
    </div>
  );
};

SuccessPopup.propTypes = {
  closePopup: func
};

SuccessPopup.defaultProps = {
  closePopup: () => {}
};

export default SuccessPopup;
