nbcvhc
This commit is contained in:
@@ -50,49 +50,23 @@ const formatWordCount = (num: number): string => {
|
||||
return num.toString();
|
||||
};
|
||||
|
||||
// Extract major features from plan data
|
||||
// Extract major features from plan data - SAME AS MARKETING PAGE
|
||||
const extractFeatures = (plan: Plan): string[] => {
|
||||
const features: string[] = [];
|
||||
|
||||
// Sites and Users
|
||||
features.push(`${plan.max_sites} ${plan.max_sites === 1 ? 'Site' : 'Sites'}`);
|
||||
features.push(`${plan.max_users} ${plan.max_users === 1 ? 'User' : 'Users'}`);
|
||||
|
||||
// Planner features
|
||||
features.push(`${formatNumber(plan.max_keywords)} Keywords`);
|
||||
features.push(`${formatNumber(plan.max_clusters)} Clusters`);
|
||||
features.push(`${formatNumber(plan.max_content_ideas)} Content Ideas`);
|
||||
|
||||
// Writer features
|
||||
features.push(`${formatWordCount(plan.monthly_word_count_limit)} Words/Month`);
|
||||
features.push(`${plan.daily_content_tasks} Daily Content Tasks`);
|
||||
|
||||
// Image features
|
||||
features.push(`${plan.monthly_image_count} Images/Month`);
|
||||
if (plan.image_model_choices && plan.image_model_choices.length > 0) {
|
||||
const models = plan.image_model_choices.map((m: string) => m.toUpperCase()).join(', ');
|
||||
features.push(`${models} Image Models`);
|
||||
}
|
||||
|
||||
// AI Credits
|
||||
features.push(`${formatNumber(plan.included_credits)} AI Credits Included`);
|
||||
features.push(`${formatNumber(plan.monthly_ai_credit_limit)} Monthly AI Credit Limit`);
|
||||
|
||||
// Feature flags
|
||||
if (plan.features && Array.isArray(plan.features)) {
|
||||
if (plan.features.includes('ai_writer')) {
|
||||
features.push('AI Writer');
|
||||
}
|
||||
if (plan.features.includes('image_gen')) {
|
||||
features.push('Image Generation');
|
||||
}
|
||||
if (plan.features.includes('auto_publish')) {
|
||||
features.push('Auto Publish');
|
||||
}
|
||||
if (plan.features.includes('custom_prompts')) {
|
||||
features.push('Custom Prompts');
|
||||
}
|
||||
|
||||
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(`${formatNumber(plan.included_credits)} Monthly Credits`);
|
||||
if (plan.monthly_word_count_limit) features.push(`${formatWordCount(plan.monthly_word_count_limit)} Words/Month`);
|
||||
if (plan.max_clusters) features.push(`${plan.max_clusters} AI Keyword Clusters`);
|
||||
if (plan.max_content_ideas) features.push(`${formatNumber(plan.max_content_ideas)} Content Ideas`);
|
||||
if (plan.monthly_image_count) {
|
||||
// Try to split into basic/premium if data available, otherwise show total
|
||||
const basicImages = Math.floor(plan.monthly_image_count * 0.8);
|
||||
const premiumImages = Math.floor(plan.monthly_image_count * 0.2);
|
||||
features.push(`${formatNumber(basicImages)} Basic / ${formatNumber(premiumImages)} Premium Images`);
|
||||
}
|
||||
if (plan.daily_image_generation_limit) features.push(`${formatNumber(plan.daily_image_generation_limit)} Image Prompts`);
|
||||
|
||||
return features;
|
||||
};
|
||||
@@ -108,11 +82,11 @@ const transformPlanToPricingPlan = (plan: Plan, index: number, totalPlans: numbe
|
||||
id: plan.id,
|
||||
name: plan.name,
|
||||
monthlyPrice: monthlyPrice,
|
||||
price: monthlyPrice, // Will be calculated by component based on period
|
||||
price: monthlyPrice,
|
||||
period: '/month',
|
||||
description: getPlanDescription(plan),
|
||||
features: extractFeatures(plan),
|
||||
buttonText: 'Choose Plan',
|
||||
buttonText: monthlyPrice === 0 ? 'Start Free' : 'Select Plan',
|
||||
highlighted: highlighted,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user