"use client";

import React, { useEffect, useState } from "react";
import "./Privacy_Policy.css";
import Breadcrumb_comp from "../common-components/breadcrumb-comp/Breadcrumb_comp";
import { useDispatch, useSelector } from "react-redux";
import { getPrivacy_Policy } from "../../features/privacypolicy/Slice";
import parse from "html-react-parser";
import { Container } from "react-bootstrap";
import Green_round_btn from "../common-components/common_btn/green_round_btn/Green_round_btn";
import Gray_Btn from "../common-components/common_btn/gray_btn/Gray_Btn";
import Success_Modal from "../common-components/common_modal/success_modal/Success_Modal";
import { useRouter } from "next/navigation";
const Privacy_Policy = () => {
  const router = useRouter();
  const breadcrumbs = [
    { label: "Home", link: "/", isActive: false },
    { label: "PRIVACY POLICY", link: "", isActive: true },
  ];
  const [showSuccessModal, setShowSuccessModal] = useState(false);
  const privacyPolicy = useSelector(
    (state) => state.privacypolicy.privacypolicy,
  );
  const dispatch = useDispatch();
  useEffect(() => {
    dispatch(getPrivacy_Policy());
  }, []);

  return (
    <>
      <section className="Privacy_Policy">
        <div className="bg_img_div">
          <div className="bg_div">
            <Container>
              <h1>Privacy Policy</h1>
            </Container>
          </div>
        </div>
        <div className="container">
          <div className="main_content_div ">
            {privacyPolicy?.map((pp) => (
              <p className="dark_black_text">{parse(pp.content)}</p>
            ))}
            {/* <div className='btns_holder'>
                            <Light_Gray_Outline_Btn btnText={"Decline"} />
                            <Green_Outline_Btn btnText={"Accept"} />
                        </div> */}
            {/* <div className="btns_holder">
              <Green_round_btn
                btnText={"Accept"}
                onClick={() => {
                  setShowSuccessModal(true);
                }}
              />{" "}
              <Gray_Btn
                btnText={"  Decline"}
                onClick={() => {
                  router.push("/");
                }}
              />{" "}
            </div> */}
          </div>
        </div>
      </section>
      {/* <Success_Modal
        show={showSuccessModal}
        onHide={() => {
          setShowSuccessModal(false);
          router.push("/");
        }}
        successText="Privacy Policy accepted successfully"
      /> */}
    </>
  );
};

export default Privacy_Policy;
