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

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

  const answers: IAnswer[] = [
    {
      id: 1,
      value: "very_confident",
      name: translate("/quiz/howConfident.answer_1"),
      questionId: "howConfident",
      onClick: handleNext,
    },
    {
      id: 2,
      value: "somewhat_confident",
      name: translate("/quiz/howConfident.answer_2"),
      questionId: "howConfident",
      onClick: handleNext,
    },
    {
      id: 3,
      value: "not_very_confident",
      name: translate("/quiz/howConfident.answer_3"),
      questionId: "howConfident",
      onClick: handleNext,
    },
    {
      id: 4,
      value: "not_confident_at_all",
      name: translate("/quiz/howConfident.answer_4"),
      questionId: "howConfident",
      onClick: handleNext,
    },
  ];

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

export default HowConfident;
