import styles from "./styles.module.scss";
import { useNavigate } from "react-router-dom";
import { useUpdateStep } from "@/components/ChatsPath/hooks/useUpdateStep";
import routes from "@/routes";
import { IAnswer } from "@/components/ChatsPath/data";
import Answers from "@/components/ChatsPath/components/Answers";
import { useTranslations } from "@/hooks/translations";
import { ELocalesPlacement } from "@/locales";

function MainReason() {
  const { translate } = useTranslations(ELocalesPlacement.Chats);
  useUpdateStep(25);
  const navigate = useNavigate();

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

  const answers: IAnswer[] = [
    {
      id: 1,
      value: "curiosity",
      name: translate("/quiz/mainReason.answer_1"),
      questionId: "mainReason",
      onClick: handleNext,
    },
    {
      id: 2,
      value: "a_specific_issue",
      name: translate("/quiz/mainReason.answer_2"),
      questionId: "mainReason",
      onClick: handleNext,
    },
    {
      id: 3,
      value: "uncertainties_in_life",
      name: translate("/quiz/mainReason.answer_3"),
      questionId: "mainReason",
      onClick: handleNext,
    },
    {
      id: 4,
      value: "upcoming_changes",
      name: translate("/quiz/mainReason.answer_4"),
      questionId: "mainReason",
      onClick: handleNext,
    },
    {
      id: 5,
      value: "all_the_above",
      name: translate("/quiz/mainReason.answer_5"),
      questionId: "mainReason",
      onClick: handleNext,
    },
  ];

  return (
    <>
      <h2 className={`chats-answers-title ${styles.title}`}>
        {translate("/quiz/mainReason.title")}
      </h2>
      <Answers answers={answers} />
    </>
  );
}

export default MainReason;
