diff --git a/src/components/auth/ConfirmationActions.tsx b/src/components/auth/ConfirmationActions.tsx new file mode 100644 index 0000000..675f38c --- /dev/null +++ b/src/components/auth/ConfirmationActions.tsx @@ -0,0 +1,93 @@ + +import { useNavigate } from 'react-router-dom'; +import { Button } from "@/components/ui/button"; +import { ConfirmationStatus } from '@/hooks/useEmailConfirmation'; + +interface ConfirmationActionsProps { + status: ConfirmationStatus; + message: string; +} + +const ConfirmationActions = ({ status, message }: ConfirmationActionsProps) => { + const navigate = useNavigate(); + + const handleBackToLogin = () => { + navigate('/auth'); + }; + + const handleGoToDashboard = () => { + navigate('/dashboard'); + }; + + const handleResendEmail = () => { + navigate('/auth', { + state: { + showSuccessMessage: true, + message: "Faça login novamente para receber um novo email de confirmação." + } + }); + }; + + if (status === 'loading') { + return ( +
+ Aguarde enquanto confirmamos seu email... +
+ ); + } + + if (status === 'success') { + return ( + <> ++ {message} +
++ {message} +
++ {message} +
+
+
- - Aguarde enquanto confirmamos seu email... -
- > - )} - - {status === 'success' && ( - <> - {getStatusIcon()} -- {message} -
-- {message} -
-- {message} -
-