import { rpcClient } from '@/api/request';
import { Lang } from '@/lang/Lang';
import { useAppConfig } from '@/stores/appConfig';

const LoginTerms = () => {


    const openTerms = () => {

        const domain = rpcClient.getCurrentEndpointDomain();
        window.open(`${domain}/terms`, '_blank');

    }

    const { auth } = useAppConfig();

    if (auth?.emailReg || auth?.phoneReg || auth?.socialReg) {

        return <div

            onClick={() => {
                openTerms();
            }}
            className='mt-6 text-xs text-center cursor-pointer mx-4'>{Lang.key('termsOfUse')} <a target='_blank'  >{Lang.key('termsOfUseLink')}</a> {Lang.key('and')} <a target='_blank'  >{Lang.key('privacyPolicyLink')}</a></div>
    }
    return null;

}

export default LoginTerms;