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

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

  const answers: IAnswer[] = [
    {
      id: 1,
      value: "often",
      name: translate("/quiz/worriesImpact.answer_1"),
      questionId: "worriesImpact",
      onClick: handleNext,
    },
    {
      id: 2,
      value: "sometimes",
      name: translate("/quiz/worriesImpact.answer_2"),
      questionId: "worriesImpact",
      onClick: handleNext,
    },
    {
      id: 3,
      value: "rarely",
      name: translate("/quiz/worriesImpact.answer_3"),
      questionId: "worriesImpact",
      onClick: handleNext,
    },
    {
      id: 4,
      value: "never",
      name: translate("/quiz/worriesImpact.answer_4"),
      questionId: "worriesImpact",
      onClick: handleNext,
    },
  ];

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

export default WorriesImpact;
