diff --git a/src/components/auth/EmailConfirmation.tsx b/src/components/auth/EmailConfirmation.tsx index def39f4..7f5bcad 100644 --- a/src/components/auth/EmailConfirmation.tsx +++ b/src/components/auth/EmailConfirmation.tsx @@ -1,17 +1,34 @@ import React from "react"; import { useNavigate } from "react-router-dom"; -import { Mail, InfoIcon } from "lucide-react"; +import { Mail, InfoIcon, RefreshCw } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; interface EmailConfirmationProps { email: string; onBackToForm: () => void; + onResendEmail?: () => Promise; } -const EmailConfirmation: React.FC = ({ email, onBackToForm }) => { +const EmailConfirmation: React.FC = ({ email, onBackToForm, onResendEmail }) => { const navigate = useNavigate(); + const [isResending, setIsResending] = useState(false); + + // 이메일 재전송 핸들러 + const handleResendEmail = async () => { + if (!onResendEmail) return; + + setIsResending(true); + try { + await onResendEmail(); + // 성공 메시지는 onResendEmail 내부에서 표시 + } catch (error) { + console.error('이메일 재전송 오류:', error); + } finally { + setIsResending(false); + } + }; return (
@@ -27,11 +44,36 @@ const EmailConfirmation: React.FC = ({ email, onBackToFo 인증 이메일이 보이지 않나요? - 스팸 폴더를 확인해보세요. 또는 다른 이메일 주소로 다시 시도하실 수 있습니다. + 스팸 폴더를 확인해보세요. 또한 이메일 서비스에 따라 도착하는데 몇 분이 걸릴 수 있습니다. + {onResendEmail && ( +
+ 아직도 받지 못했다면 아래 '인증 메일 재전송' 버튼을 클릭하세요. +
+ )}
+ {onResendEmail && ( + + )} +