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

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

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

  const answers = whatEmotionAnswers.map((answer) => {
    return {
      ...answer,
      name: translate(answer.name as string),
      onClick: handleNext,
    };
  });

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

export default WhatEmotion;
