'use client'; import { useTranslations } from 'next-intl'; import { useState } from 'react'; import { verifyTenantEmail } from '@/app/lib/actions/emailActions'; import { CheckCircleIcon } from '@heroicons/react/24/outline'; interface EmailVerifyPageProps { shareId: string; } export default function EmailVerifyPage({ shareId }: EmailVerifyPageProps) { const t = useTranslations('email-verify-page'); const [isVerifying, setIsVerifying] = useState(false); const [isVerified, setIsVerified] = useState(false); const [error, setError] = useState(null); const handleVerify = async () => { setIsVerifying(true); setError(null); try { const result = await verifyTenantEmail(shareId); if (result.success) { setIsVerified(true); } else { setError(result.message || t('error.unknown')); } } catch (err) { setError(t('error.unknown')); } finally { setIsVerifying(false); } }; if (isVerified) { return (

{t('success.title')}

{t('success.message')}

); } if (error) { return (

{t('error.title')}

{error}

); } return (

{t('title')}

{t('about.title')}

{t('about.description')}

{t('why.title')}

{t('why.description')}

{t('what-happens.title')}

{t('what-happens.description')}

{t('opt-out.title')}

{t('opt-out.description')}

); }