'use client' import FormWrapper from '@/components/FormWrapper' import { Separator } from '@/components/ui/separator' import { FormItems } from '@/lib/types/types' type StepProps = FormItems & { goTo: (index: number) => void } const FinalStep = ({ yearly, plan, addOns, goTo }: StepProps) => { let planPrice = 0 switch (plan) { case 'arcade': planPrice = 9 break case 'advanced': planPrice = 12 break case 'pro': planPrice = 15 break default: planPrice = 0 break } const filteredAddOns = addOns.filter((addOn) => addOn.checked === true) const totalAddOnsPrice = filteredAddOns?.reduce((acc, obj) => acc + obj.price, 0) console.log(totalAddOnsPrice) return (
{' '} {/* Adjusted colors */}

{`${plan.charAt(0).toUpperCase() + plan.slice(1)} (${yearly ? 'Yearly' : 'Monthly'})`}

{`$${yearly ? planPrice * 10 : planPrice}${yearly ? '/yr' : '/mo'}`}

{filteredAddOns.length > 0 && } {filteredAddOns?.map((addOn) => (

{addOn.title}

{/* Adjusted color */}

{`$${yearly ? addOn.price * 10 : addOn.price}${yearly ? '/yr' : '/mo'}`}

))}

Total (per {yearly ? 'year' : 'month'})

+$ {yearly ? planPrice * 10 + totalAddOnsPrice * 10 : planPrice + totalAddOnsPrice}/{yearly ? 'yr' : 'mo'}

) } export default FinalStep