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 InterestedHowLong() {
  const { translate } = useTranslations(ELocalesPlacement.Chats);
  useUpdateStep(24);
  const navigate = useNavigate();

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

  const answers: IAnswer[] = [
    {
      id: 1,
      value: "beginner",
      name: translate("/quiz/interestedHowLong.answer_1"),
      questionId: "interestedHowLong",
      onClick: handleNext,
    },
    {
      id: 2,
      value: "up_to_a_year",
      name: translate("/quiz/interestedHowLong.answer_2"),
      questionId: "interestedHowLong",
      onClick: handleNext,
    },
    {
      id: 3,
      value: "for_1_2_years",
      name: translate("/quiz/interestedHowLong.answer_3"),
      questionId: "interestedHowLong",
      onClick: handleNext,
    },
    {
      id: 4,
      value: "from_2_to_5_years",
      name: translate("/quiz/interestedHowLong.answer_4"),
      questionId: "interestedHowLong",
      onClick: handleNext,
    },
    {
      id: 5,
      value: "for_more_than_5_years",
      name: translate("/quiz/interestedHowLong.answer_5"),
      questionId: "interestedHowLong",
      onClick: handleNext,
    },
  ];

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

export default InterestedHowLong;
