'use client'

import SubscribeProductItem from './SubscribeProductItem'

const SubscribeProducts = ({
  pricingPlans,
  setSelectedPlan,
}: {
  pricingPlans: {
    id: number
    title: string
    subtitle: string
    price: string
    isSelected: boolean
    discount: string
    productId?: string
  }[]
  setSelectedPlan: (id: number) => void
}) => {
  return (
    <div className="w-full space-y-6 px-6">
      {pricingPlans.map((plan) => (
        <SubscribeProductItem key={plan.id} {...plan} onSelect={() => setSelectedPlan(plan.id)} />
      ))}
    </div>
  )
}

export default SubscribeProducts
