import { useState, useEffect } from 'react' import { AlertTriangle, X, Loader2 } from 'lucide-react' import { authApi } from '@/api/auth' import { useAuthStore } from '@/store/authStore' import { cn } from '@/lib/utils' import { toast } from '@/lib/toast' export function EmailVerificationBanner() { const user = useAuthStore((s) => s.user) const [dismissed, setDismissed] = useState(false) const [isSending, setIsSending] = useState(false) const [verificationEnabled, setVerificationEnabled] = useState(true) useEffect(() => { authApi.getVerificationStatus() .then((data) => setVerificationEnabled(data.enabled)) .catch(() => {}) }, []) if (!user || user.email_verified_at || dismissed || !verificationEnabled) return null const handleResend = async () => { setIsSending(true) try { await authApi.sendVerificationEmail() toast.success('Verification email sent') } catch { toast.error('Failed to send verification email') } finally { setIsSending(false) } } return (