import React, { useState, useEffect } from 'react'; import { View, Text, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'; import { subscriptionService } from '../services/subscriptionService'; export default function SubscriptionScreen() { const [subscription, setSubscription] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { loadSubscription(); }, []); const loadSubscription = async () => { const data = await subscriptionService.getSubscription(); setSubscription(data); setLoading(false); }; const handleUpgrade = async (plan: string) => { const { url } = await subscriptionService.createCheckout(plan); // Open Polar checkout in browser }; if (loading) return ; return ( Subscription Free $0/mo ✓ Basic features ✓ 100 posts/month ✓ 1GB storage {subscription?.plan === 'free' && ( Current Plan )} POPULAR Premium $9/mo ✓ Verified badge ✓ Custom themes ✓ Ad-free ✓ 10GB storage handleUpgrade('premium')} className="bg-blue-500 py-3 rounded items-center" > Upgrade Creator $29/mo ✓ All Premium features ✓ Advanced analytics ✓ Content scheduling ✓ 100GB storage handleUpgrade('creator')} className="bg-blue-500 py-3 rounded items-center" > Upgrade ); }