import Title from "@/components/Title"
import styles from "../../styles.module.scss"
import { useTranslations } from "@/hooks/translations";
import { ELocalesPlacement } from "@/locales";
import PrivacyPolicy from "@/components/pages/ABDesign/v1/components/PrivacyPolicy";
import { Gender } from "@/data";
import { genders } from "@/components/pages/ABDesign/v1/data/genders";
import Answer from "@/components/CompatibilityV2/components/Answer";
import AlreadyHaveAccount from "@/components/ui/AlreadyHaveAccount";

interface IGenderV1Props {
    localGenders: Array<{
        id: string;
        title: React.ReactNode | string;
    }>;
    gender: string;
    selectGender: (gender: Gender | null) => void;
}

function GenderV1({ localGenders, gender, selectGender }: IGenderV1Props) {
    const { translate } = useTranslations(ELocalesPlacement.CompatibilityV2);

    return (
        <>
            <Title variant="h2" className={styles.title}>
                {translate("/gender.v1.title", {
                    br: <br />,
                })}
            </Title>
            <p className={styles.subtitle}>{translate("/gender.v1.subtitle", {
                br: <br />,
            })}</p>
            <ul className={styles.points}>
                {Array.from({ length: 4 }).map((_, index) => (
                    <li key={index}>
                        {translate(`/gender.v1.points.point${index + 1}`)}
                    </li>
                ))}
            </ul>
            {/* <ChooseGender onSelectGender={selectGender} /> */}
            <div className={styles["genders-container"]}>
                {localGenders.map((_gender, index) => (
                    <Answer
                        key={index}
                        answer={_gender}
                        isSelected={gender === _gender.id}
                        onClick={() => selectGender(genders.find((g) => g.id === _gender.id) ?? null)}
                    />
                ))}
            </div>
            <PrivacyPolicy containerClassName={styles["privacy-policy"]} haveCheckbox={false} />
            <AlreadyHaveAccount text={translate("/gender.already_have_account")} />
            {/* {gender && !privacyPolicyChecked && (
            <Toast classNameContainer={styles["toast-container"]} variant="error">
              {translate("/gender.toast", undefined, ELocalesPlacement.V1)}
            </Toast>
          )} */}
        </>
    )
}

export default GenderV1