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 IGenderV0Props {
    localGenders: Array<{
        id: string;
        title: React.ReactNode | string;
    }>;
    gender: string;
    selectGender: (gender: Gender | null) => void;
}

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

    return (
        <>
            <Title variant="h2" className={styles.title}>
                {translate("/gender.title")}
            </Title>
            <p className={styles.description}>{translate("/gender.description", {
                br: <br />,
            })}</p>
            {/* <ChooseGender onSelectGender={selectGender} /> */}
            <PrivacyPolicy containerClassName={styles["privacy-policy"]} haveCheckbox={false} />
            <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>
            <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 GenderV0