1
1
import InputError from '@/components/input-error' ;
2
- import { Alert , AlertDescription , AlertTitle } from '@/components/ui/alert' ;
3
2
import { Button } from '@/components/ui/button' ;
4
3
import { Dialog , DialogContent , DialogDescription , DialogHeader , DialogTitle } from '@/components/ui/dialog' ;
5
4
import { InputOTP , InputOTPGroup , InputOTPSlot } from '@/components/ui/input-otp' ;
@@ -8,8 +7,9 @@ import { OTP_MAX_LENGTH } from '@/hooks/use-two-factor-auth';
8
7
import { confirm } from '@/routes/two-factor' ;
9
8
import { Form } from '@inertiajs/react' ;
10
9
import { REGEXP_ONLY_DIGITS } from 'input-otp' ;
11
- import { AlertCircleIcon , Check , Copy , Loader2 , ScanLine } from 'lucide-react' ;
10
+ import { Check , Copy , Loader2 , ScanLine } from 'lucide-react' ;
12
11
import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
12
+ import AlertError from './alert-error' ;
13
13
14
14
function GridScanIcon ( ) {
15
15
return (
@@ -50,17 +50,7 @@ function TwoFactorSetupStep({
50
50
return (
51
51
< >
52
52
{ errors ?. length ? (
53
- < Alert variant = "destructive" >
54
- < AlertCircleIcon />
55
- < AlertTitle > Something went wrong.</ AlertTitle >
56
- < AlertDescription >
57
- < ul className = "list-inside list-disc text-sm" >
58
- { Array . from ( new Set ( errors ) ) . map ( ( error , index ) => (
59
- < li key = { index } > { error } </ li >
60
- ) ) }
61
- </ ul >
62
- </ AlertDescription >
63
- </ Alert >
53
+ < AlertError errors = { errors } />
64
54
) : (
65
55
< >
66
56
< div className = "mx-auto flex max-w-md overflow-hidden" >
0 commit comments