import { compose } from 'recompose'

import firebase, { GoogleAuthProvider } from '../firebase/firebase'

const SignInWithGoogleButton = () => {
  const signInWithGoogle = async () => {
    try {
      await firebase.auth().signInWithPopup(GoogleAuthProvider)
    } catch (e) {
      console.error(e)
    }
    //mergeOrdersAsync({ items: ordersItems })
  }
  return <button onClick={signInWithGoogle}>signin</button>
}

const enhance = compose()

export default enhance(SignInWithGoogleButton)
