'use client' import { CardWrapper } from '@/components/auth/card-wrapper' import { AUTH_LOGIN_URL } from '@/config/routes' import { useI18n } from '@/locales/client' import { useCallback, useEffect, useState } from 'react' import { userVerification } from '@/actions/user-verification' import FormSuccess from '@/components/form-success' import FormError from '@/components/form-error' import { Bars } from 'react-loader-spinner' const UserVerificationForm = ({ token }: { token: string }) => { const [error, setError] = useState(undefined) const [success, setSuccess] = useState(undefined) const onSubmit = useCallback(() => { userVerification(token).then(data => { setSuccess(data?.success) setError(data?.error) }).catch(() => { setError('something went wrong') }) }, [token]) useEffect(() => onSubmit(), [onSubmit]) const t = useI18n() return (
) } export default UserVerificationForm