import React from 'react';
import { signInWithToken } from '../connection';
import { GoogleLogin } from 'react-google-login';

const CMSGoogleLogin = ({
    clientId = '1020405052548-c177prrtihlgsfiqg839r247fl2459pp.apps.googleusercontent.com',
    text = 'Login'
}) => (
        <GoogleLogin
            buttonText={text}
            clientId={clientId}
            onSuccess={(data) => {
                signInWithToken(data.tokenId);
            }}
        />
    );

console.log('cmslink data',CMSGoogleLogin);

export default CMSGoogleLogin;