summaryrefslogtreecommitdiff
path: root/components/login/SuccessPage.tsx
blob: 5a696441959558af8d5c4f39c5fea479b3165583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// app/[lng]/auth/reset-password/components/SuccessPage.tsx

'use client';

import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { CheckCircle } from 'lucide-react';
import Link from 'next/link';

interface Props {
  message?: string;
}

export default function SuccessPage({ message }: Props) {
  const router = useRouter();

  // 3초 후 자동 리다이렉트
  useEffect(() => {
    const timer = setTimeout(() => {
      router.push('/partners');
    }, 3000);

    return () => clearTimeout(timer);
  }, [router]);

  return (
    <Card className="w-full max-w-md">
      <CardHeader className="text-center">
        <div className="mx-auto flex items-center justify-center w-12 h-12 rounded-full bg-green-100 mb-4">
          <CheckCircle className="w-6 h-6 text-green-600" />
        </div>
        <CardTitle className="text-2xl">재설정 완료</CardTitle>
        <CardDescription>
          {message || '비밀번호가 성공적으로 변경되었습니다.'}
        </CardDescription>
      </CardHeader>
      <CardContent>
        <div className="text-center space-y-4">
          <p className="text-sm text-gray-600">
            잠시 후 로그인 페이지로 자동 이동합니다...
          </p>
          <Link href="/auth/login">
            <Button className="w-full">
              지금 로그인하기
            </Button>
          </Link>
        </div>
      </CardContent>
    </Card>
  );
}