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

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

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

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

export default SensitiveToCriticism;
