import Title from "@/components/Title";
import styles from "./styles.module.css";
import MainButton from "@/components/MainButton";
import { useNavigate } from "react-router-dom";
import routes from "@/routes";
import { selectors } from "@/store";
import { useSelector } from "react-redux";
import { getZodiacSignByDate } from "@/services/zodiac-sign";

function AllRightPage() {
  const navigate = useNavigate();
  const { birthdate } = useSelector(selectors.selectQuestionnaire);
  const zodiacSign = getZodiacSignByDate(birthdate);

  const handleBack = () => {
    navigate(-1);
  };

  const handleNext = () => {
    navigate(`${routes.client.questionnaire()}/personalityTraits/attitude`);
  };

  return (
    <section className={`${styles.page} page`}>
      <img src="/sun.svg" alt="The sun" style={{ minHeight: "188px" }} />
      <div>
        <Title variant="h1" className={styles.title}>
          All right! <br /> You keep your emotions in check{" "}
          <span style={{ color: "#f2c94c" }}>{zodiacSign}</span>, but sometimes
          people might want you to show more passion. We can give you some
          insights about that!
        </Title>
      </div>
      <div className={styles["buttons-container"]}>
        <MainButton
          className={`${styles.button} ${styles["back-button"]}`}
          onClick={handleBack}
        >
          Back
        </MainButton>
        <MainButton
          className={`${styles.button} ${styles["next-button"]}`}
          onClick={handleNext}
        >
          Next
        </MainButton>
      </div>
    </section>
  );
}

export default AllRightPage;
