import routes from "@/routes";
import styles from "./styles.module.scss";
import Title from "@/components/Title";
import Button from "../../components/Button";
import { useNavigate } from "react-router-dom";
import BiometricData from "@/components/palmistry/biometric-data/biometric-data";
import { useTranslations } from "@/hooks/translations";
import { ELocalesPlacement } from "@/locales";
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
import { DotLottieReact } from "@lottiefiles/dotlottie-react";

function LetScan() {
  const { translate } = useTranslations(ELocalesPlacement.CompatibilityV4);
  const navigate = useNavigate();
  const { animationData } = useLottie({
    loadKey: ELottieKeys.letScan,
  });

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

  return (
    <div className={styles.page}>
      <div className={styles["lottie-animation-container"]}>
        {animationData &&
          <DotLottieReact
            className={`${styles["lottie-animation"]} ym-hide-content`}
            data={animationData}
            autoplay
            loop={false}
            width={323}
          />}
      </div>
      <Title variant="h2" className={styles.title}>
        {translate("/let-scan.title")}
      </Title>
      <p className={styles.text}>{translate("/let-scan.text")}</p>
      <Button className={styles.button} onClick={handleNext}>
        {translate("next")}
      </Button>
      <BiometricData className={styles.biometric} />
    </div>
  );
}

export default LetScan;
