import Title from "@/components/Title";
import styles from "./styles.module.scss";
import routes from "@/routes";
import Button from "../../components/Button";
import BiometricData from "@/components/palmistry/biometric-data/biometric-data";
import { useNavigate } from "react-router-dom";
import { useTranslations } from "@/hooks/translations";
import { ELocalesPlacement } from "@/locales";
import ScanInstructionSVG from "../../images/SVG/ScanInstruction";
import { usePreloadImages } from "@/hooks/preload/images";

function ScanInstruction() {
  const { translate } = useTranslations(ELocalesPlacement.CompatibilityV4);
  const navigate = useNavigate();
  usePreloadImages([
    "/v1/palmistry/love-line.svg",
    "/v1/palmistry/head-line.svg",
    "/v1/palmistry/life-line.svg",
    "/v1/palmistry/fate-line.svg",
    "/v1/palmistry/hand-little-finger.svg",
  ]);

  const handleClick = () => {
    navigate(routes.client.compatibilityV4Camera());
  };

  return (
    <div className={styles.page}>
      <Title variant="h2" className={styles.title}>
        {translate("/scan-instruction.title")}
      </Title>
      <ScanInstructionSVG />
      <Button className={styles.button} onClick={handleClick}>
        {translate("/scan-instruction.button")}
      </Button>
      <BiometricData className={styles.biometric} />
    </div>
  );
}

export default ScanInstruction;
