mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-01 03:09:34 +00:00
General Updates
This commit is contained in:
parent
d4586b1fa5
commit
beb661143b
4 changed files with 12 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { toast } from 'sonner';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import { stripeRedirect } from '@/actions/stripe-redirect';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
@ -13,10 +14,11 @@ interface SubscriptionButtonProps {
|
|||
|
||||
export const SubscriptionButton = ({ isPro }: SubscriptionButtonProps) => {
|
||||
const proModal = useProModal();
|
||||
const router = useRouter();
|
||||
|
||||
const { execute, isLoading } = useAction(stripeRedirect, {
|
||||
onSuccess: (data) => {
|
||||
window.location.href = data;
|
||||
router.push(data);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error(error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue