page.tsx62 lines, 2.0 KB
| 1 | "use client"; |
| 2 | |
| 3 | import React, { useEffect } from "react"; |
| 4 | import { useRouter, useSearchParams } from "next/navigation"; |
| 5 | import { |
| 6 | Card, |
| 7 | CardContent, |
| 8 | CardDescription, |
| 9 | CardFooter, |
| 10 | CardHeader, |
| 11 | CardTitle, |
| 12 | } from "@/components/ui/card"; |
| 13 | import { Button } from "@/components/ui/button"; |
| 14 | import { CheckCircle } from "lucide-react"; |
| 15 | import { toast } from "sonner"; |
| 16 | |
| 17 | export default function SubscriptionSuccessPage() { |
| 18 | const router = useRouter(); |
| 19 | const searchParams = useSearchParams(); |
| 20 | const sessionId = searchParams.get("session_id"); |
| 21 | |
| 22 | useEffect(() => { |
| 23 | if (sessionId) { |
| 24 | toast.success("Subscription successful! Your account has been upgraded."); |
| 25 | } |
| 26 | }, [sessionId]); |
| 27 | |
| 28 | return ( |
| 29 | <div className="container mx-auto px-4 py-16 flex justify-center"> |
| 30 | <Card className="max-w-md w-full"> |
| 31 | <CardHeader className="text-center"> |
| 32 | <div className="flex justify-center mb-4"> |
| 33 | <CheckCircle className="h-16 w-16 text-green-500" /> |
| 34 | </div> |
| 35 | <CardTitle className="text-2xl">Subscription Successful!</CardTitle> |
| 36 | <CardDescription> |
| 37 | Thank you for subscribing. Your account has been upgraded |
| 38 | successfully. |
| 39 | </CardDescription> |
| 40 | </CardHeader> |
| 41 | <CardContent className="text-center"> |
| 42 | <p> |
| 43 | Your subscription is now active and you can start using the premium |
| 44 | features right away. |
| 45 | </p> |
| 46 | <p className="mt-4 text-sm text-muted-foreground"> |
| 47 | If you have any questions or need assistance, please contact our |
| 48 | support team. |
| 49 | </p> |
| 50 | </CardContent> |
| 51 | <CardFooter className="flex justify-center gap-4"> |
| 52 | <Button onClick={() => router.push("/subscriptions/manage")}> |
| 53 | Manage Subscription |
| 54 | </Button> |
| 55 | <Button variant="outline" onClick={() => router.push("/dashboard")}> |
| 56 | Go to Dashboard |
| 57 | </Button> |
| 58 | </CardFooter> |
| 59 | </Card> |
| 60 | </div> |
| 61 | ); |
| 62 | } |