'use client' import { Check, Sparkle } from 'lucide-react' import { Button } from '@/components/ui/button' import { useState } from 'react' import { toast } from 'react-hot-toast' import axios from 'axios' import { useCurrentUser } from '@/hooks/use-current-user' import { useRouter } from 'next/navigation' // Update Tiers Here export const tiers = [ { name: 'Your Competitor Name', price: '18.99', features: [ 'Feature 1', 'Feature 2', 'Feature 3', 'Feature 4', 'Feature 5', 'Feature 6', 'Feature 7', 'Feature 8', 'Feature 9', 'Feature 10' ], cta: 'Get Started', yourProduct: false }, { name: 'Your Product Name', priceBefore: '$19.99', price: '8.99', features: [ 'Feature 1', 'Feature 2', 'Feature 3', 'Feature 4', 'Feature 5', 'Feature 6', 'Feature 7', 'Feature 8', 'Feature 9', 'Feature 10' ], cta: 'Get Started', yourProduct: true } ] export const PricingCard = () => { const [isLoading, setIsLoading] = useState(false) const session = useCurrentUser() const router = useRouter(); const onClick = async () => { if (!session) { toast('👇 Sign in to purchase!') router.push('/login') return } try { setIsLoading(true) const response = await axios.post('/api/checkout') window.location.href = response.data.url } catch (error) { toast.error('An error occured! Please try again.') } finally { setIsLoading(false) } } return (
{/* Title */}

Pricing

Describe your product / service here that will impress the user & want them to buy the product

{/* Pricing Card Display */}
{tiers.map((tier) => (
{tier.yourProduct && (
Popular
)} {/* Pricing */}

{tier.name}

{tier.priceBefore ? ( {tier.priceBefore} ) : null} ${tier.price} /month
    {tier.features.map((feature, index) => (
  • {feature}
  • ))}
{/* Button */}
))}
) }