import React, { useState, useEffect, useRef } from 'react'; import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts'; import { initLocalEngine, routeInference } from '../utils/inferenceRouter'; import HCaptcha from '@hcaptcha/react-hcaptcha'; import { supabase, useAuth, GATEWAY_URL, LEMON_CHECKOUT_URL } from '../context'; export default function BillingCard({ tier, userId }) { const handleUpgrade = (planId) => { // Open Lemon Squeezy checkout with user_id in custom_data const url = `${LEMON_CHECKOUT_URL}?checkout[custom][user_id]=${userId}&checkout[custom][plan]=${planId}` window.open(url, '_blank') } const handlePortal = () => { // Mock customer portal url alert("Redirecting to LemonSqueezy Customer Portal... (requires backend API token)"); } return (

Subscription & Billing

Manage your current plan, view invoice history, and upgrade limits.

{/* Free Plan */}
Free Tier
$0 /mo
  • 100 API Calls / month
  • Community Support
  • 1 Active Monitor
{tier === 'free' ? ( ) : ( )}
{/* Pro Plan */}
Pro Tier {tier === 'pro' && Active}
$29 /mo
  • 5,000 API Calls / month
  • Priority Support
  • 50 Active Monitors
{tier === 'pro' ? ( ) : ( )}
{/* Business Plan */}
Business
$99 /mo
  • 20,000 API Calls / month
  • Priority Support
  • 200 Active Monitors
{tier === 'business' ? ( ) : ( )}
{/* Enterprise Plan */}
Enterprise
$249 /mo
  • 100,000 API Calls / month
  • Dedicated Account Manager
  • Unlimited Monitors
{tier === 'enterprise' ? ( ) : ( )}

Account Hub

Logged in as: {userId}

) }