added tons of features
This commit is contained in:
29
components/auth/google-login.tsx
Normal file
29
components/auth/google-login.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client'
|
||||
|
||||
import {useActionState} from 'react'
|
||||
|
||||
import {googleAuthenticate} from '@/actions/auth/google-login'
|
||||
import GoogleIcon from '@/components/shared/icons/google'
|
||||
import {Button} from '@/ui/button'
|
||||
|
||||
const GoogleLogin = () => {
|
||||
const [errorMsgGoogle, dispatchGoogle] = useActionState(
|
||||
googleAuthenticate,
|
||||
undefined
|
||||
) //googleAuthenticate hook
|
||||
|
||||
return (
|
||||
<form className='mt-4 flex' action={dispatchGoogle}>
|
||||
<Button
|
||||
variant={'outline'}
|
||||
className='flex w-full flex-row items-center gap-3'
|
||||
>
|
||||
<GoogleIcon />
|
||||
Google Sign In
|
||||
</Button>
|
||||
<p>{errorMsgGoogle}</p>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
|
||||
export default GoogleLogin
|
||||
Reference in New Issue
Block a user