import React, { useContext } from "react";
import { LanguageContext } from "../../backend/LanguageContext";

const FinalStage = ({
  setModalOpen,
  acceptedMessageTkm,
  acceptedMessage,
  acceptedMessageEn,
}) => {
  const { locale } = useContext(LanguageContext);

  return (
    <section className="imm-cs-1 cs-1">
      <form>
        <h2 className="succes-title">
          {locale === "TKM"
            ? acceptedMessageTkm
            : locale === "РУС"
            ? acceptedMessage
            : locale === "ENG"
            ? acceptedMessageEn
            : acceptedMessageTkm}
        </h2>

        <div className="cu-bottom cd-2-title">
          <button
            type="submit"
            onClick={() => setModalOpen(false)}
            className="sign-btn cu-btn"
          >
            <div>
              <h3>
                {locale === "TKM"
                  ? "Çykmak"
                  : locale === "РУС"
                  ? "Закрыть  "
                  : locale === "ENG"
                  ? "Close"
                  : "Çykmak"}
              </h3>
            </div>
          </button>
        </div>
      </form>
    </section>
  );
};

export default FinalStage;
