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 { useSelector } from "react-redux";
import { selectors } from "@/store";
import { getZodiacSignByDate } from "@/services/zodiac-sign";

function WithHeadPage() {
  const navigate = useNavigate();
  const birthdate = useSelector(selectors.selectBirthdate);
  const zodiacSign = getZodiacSignByDate(birthdate);

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

  const handleNext = () => {
    navigate(routes.client.aboutUs());
  };

  return (
    <section className={`${styles.page} page`}>
      <img
        src="/scalesHead.svg"
        alt="The scales"
        style={{ minHeight: "255px" }}
      />
      <div>
        <Title variant="h1" className={styles.title}>
          Based on our data, 39% of{" "}
          <span style={{ color: "#f2c94c" }}>{zodiacSign}</span> people also
          make decisions with their head. But don't worry, we'll consider that
          while creating your guidance plan.
        </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 WithHeadPage;
