import { useTranslations } from "next-intl";
import { FC } from "react";
import "./style.scss";

/**
 * @description 谷歌登录注册组件
 * @param {string} title 标题
 * @param {string} text 按钮文本
 * @param {() => void} callbackFun 回调方法
 */
export interface GoogleComProps {
    title?: string;
    text?: string;
    callbackFun?: () => void;
}

const GoogleCom: FC<GoogleComProps> = ({ title = "", text = "", callbackFun }) => {
    const t = useTranslations("LoginPage");
    return (
        <div className="GoogleCom">
            <div className="title">
                <h2>{title || t("Googletitle")}</h2>
            </div>
            <div className="otherAccount">
                <div className="ggAfb" onClick={callbackFun}>
                    <span className="gg">
                        <i></i> {text || t("Googletext")}
                    </span>
                </div>
                <div className="or">
                    <span>OU</span>
                </div>
            </div>
        </div>
    );
};

export default GoogleCom;
