--- /** * Shared Pricing Section component */ import Container from '../atoms/Container.astro'; import Card from '../atoms/Card.astro'; import Button from '../atoms/Button.astro'; import Badge from '../atoms/Badge.astro'; import SectionHeader from '../atoms/SectionHeader.astro'; interface PricingFeature { text: string; included: boolean; } interface PricingPlan { name: string; description?: string; price: string; period?: string; features: PricingFeature[] | string[]; cta: { text: string; href: string; }; highlighted?: boolean; badge?: string; } interface Props { title: string; subtitle?: string; plans: PricingPlan[]; class?: string; id?: string; } const { title, subtitle, plans, class: className = '', id = 'pricing' } = Astro.props; // Normalize features to always have { text, included } format function normalizeFeatures(features: PricingFeature[] | string[]): PricingFeature[] { return features.map((f) => (typeof f === 'string' ? { text: f, included: true } : f)); } ---
= 4 && 'md:grid-cols-2 lg:grid-cols-4', ]} > { plans.map((plan) => ( {plan.badge && (
{plan.badge}
)}

{plan.name}

{plan.description && (

{plan.description}

)}
{plan.price} {plan.period && ( /{plan.period} )}
    {normalizeFeatures(plan.features).map((feature) => (
  • {feature.included ? ( ) : ( )} {feature.text}
  • ))}
)) }