mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
35 lines
912 B
TypeScript
35 lines
912 B
TypeScript
import { useRouter } from 'next/router'
|
|
import { useEffect } from 'react'
|
|
import { Layout } from 'src/components/common'
|
|
import LoadingCommon from 'src/components/common/LoadingCommon/LoadingCommon'
|
|
import { useVerifyCustomer } from 'src/components/hooks'
|
|
|
|
export default function VerifyCustomer() {
|
|
const router = useRouter()
|
|
const { error, loading, verify } = useVerifyCustomer()
|
|
|
|
useEffect(() => {
|
|
const { token } = router.query
|
|
console.log("token: ", token)
|
|
if (token) {
|
|
verify({ token: token.toString() })
|
|
}
|
|
}, [])
|
|
|
|
return (
|
|
<div>
|
|
{
|
|
loading ? <>
|
|
<LoadingCommon />
|
|
Verifing your account ....
|
|
</> : <div className="error">
|
|
{error?.message}
|
|
</div>
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
|
|
VerifyCustomer.Layout = Layout
|