pricign plans updates

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-25 12:42:25 +00:00
parent e736697d6d
commit 4248fd0969
4 changed files with 145 additions and 116 deletions

View File

@@ -17,6 +17,7 @@ import PricingTable1 from '../../components/ui/pricing-table/pricing-table-1';
import CreditCostBreakdownPanel from '../../components/billing/CreditCostBreakdownPanel';
import CreditCostsPanel from '../../components/billing/CreditCostsPanel';
import UsageLimitsPanel from '../../components/billing/UsageLimitsPanel';
import { convertToPricingPlan } from '../../utils/pricingHelpers';
import {
getCreditBalance,
getCreditPackages,
@@ -727,46 +728,11 @@ export default function PlansAndBillingPage() {
const planPrice = plan.price || 0;
return planPrice > 0 && !planName.includes('free');
})
.map(plan => {
const discount = plan.annual_discount_percent || 15;
// Get custom description based on plan name
let description = 'Standard plan';
const planName = plan.name.toLowerCase();
if (planName.includes('starter')) {
description = 'Launch SEO workflows for small teams';
} else if (planName.includes('growth')) {
description = 'Scale content production with confidence';
} else if (planName.includes('scale')) {
description = 'Enterprise power for high volume growth';
}
// Build features array
const features: string[] = [];
if (plan.max_sites) features.push(`${plan.max_sites === 999999 ? 'Unlimited' : plan.max_sites} Site${plan.max_sites > 1 ? 's' : ''}`);
if (plan.max_users) features.push(`${plan.max_users} Team User${plan.max_users > 1 ? 's' : ''}`);
if (plan.included_credits) features.push(`${(plan.included_credits / 1000).toFixed(0)}K Monthly Credits`);
if (plan.max_content_words) features.push(`${(plan.max_content_words / 1000).toFixed(0)}K Words/Month`);
if (plan.max_clusters) features.push(`${plan.max_clusters} AI Keyword Clusters`);
if (plan.max_content_ideas) features.push(`${plan.max_content_ideas} Content Ideas`);
if (plan.max_images_basic && plan.max_images_premium) {
features.push(`${plan.max_images_basic} Basic / ${plan.max_images_premium} Premium Images`);
}
return {
id: plan.id,
name: plan.name,
monthlyPrice: plan.price || 0,
price: plan.price || 0,
annualDiscountPercent: discount,
period: '/month',
description: description,
features: features.length > 0 ? features : ['Monthly credits included', 'Module access', 'Email support'],
buttonText: plan.id === currentPlanId ? 'Current Plan' : 'Choose Plan',
highlighted: plan.is_featured || false,
disabled: plan.id === currentPlanId || planLoadingId === plan.id,
};
})}
.map(plan => ({
...convertToPricingPlan(plan),
buttonText: plan.id === currentPlanId ? 'Current Plan' : 'Choose Plan',
disabled: plan.id === currentPlanId || planLoadingId === plan.id,
}))}
showToggle={true}
onPlanSelect={(plan) => plan.id && handleSelectPlan(plan.id)}
/>