@@ -424,47 +424,38 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
424424 { selectedAddon . pricing ?. [ quantityIndex ] ?. units || 0 } { selectedAddon ?. unitLabel }
425425 </ Typography >
426426 < Slider
427- value = { quantityIndex }
428- onChange = { ( event , newValue ) => setQuantityIndex ( newValue ) }
429- min = { 0 }
430- valueLabelDisplay = "auto"
431- valueLabelFormat = { ( value ) => {
432- const option = selectedAddon ?. pricing ?. [ value ] ;
433- if ( option ) {
434- const pricePerUnit = isYearly ? option . yearlyPerUnit : option . monthlyPerUnit ;
435- const totalPrice = pricePerUnit * option . units ;
436- const period = isYearly ? "/year" : "/month" ;
437- return `${ option . units } ${ selectedAddon . unitLabel ?. slice ( 0 , - 1 ) || "unit" } - ${ formatPrice ( totalPrice ) } ${ period } ` ;
438- }
439- return "" ;
440- } }
441- max = { ( selectedAddon ?. pricing ?. length - 1 ) || 0 }
442- step = { null }
443- sx = { getSliderStyle ( sliderStyles . baseOther , "1rem" ) } // ← use same style as academy
444- marks = { selectedAddon ?. pricing ?. map ( ( option , index ) => ( {
445- value : index ,
446- label : (
447- < Box sx = { { textAlign : "center" , fontSize : "1.25rem" , fontWeight : "bold" } } >
448- < Box > { option . units } </ Box >
449- < Box
450- sx = { {
451- color : "text.secondary" ,
452- mb : 1.5 ,
453- fontSize : {
454- xs : "0.75rem" ,
455- sm : "0.9rem" ,
456- }
457- } } >
458- { formatPrice ( isYearly ? option . yearlyPerUnit : option . monthlyPerUnit ) } < br /> { selectedAddon . unitLabel ?. slice ( 0 , - 1 ) || "unit" } /{ isYearly ? "year" : "month" }
459- </ Box >
427+ value = { quantityIndex }
428+ onChange = { ( event , newValue ) => setQuantityIndex ( newValue ) }
429+ min = { 0 }
430+ max = { selectedAddon ?. pricing ?. length - 1 || 0 }
431+ step = { null }
432+ valueLabelDisplay = "auto"
433+ valueLabelFormat = { ( value ) => {
434+ if ( selectedAddon ?. pricing && selectedAddon . pricing [ value ] ) {
435+ const option = selectedAddon . pricing [ value ] ;
436+ const unitPrice = isYearly ? option . yearlyPerUnit : option . monthlyPerUnit ;
437+ const totalPrice = unitPrice * option . units ;
438+ const period = isYearly ? "/year" : "/month" ;
439+ return `${ option . units } ${ selectedAddon ?. unitLabel ?. slice ( 0 , - 1 ) || "unit" } - ${ formatPrice ( totalPrice ) } ${ period } ` ;
440+ }
441+ return "" ;
442+ } }
443+ sx = { getSliderStyle ( sliderStyles . baseOther , "14px" ) }
444+ marks = { selectedAddon ?. pricing ?. map ( ( option , index ) => ( {
445+ value : index ,
446+ label : (
447+ < Box sx = { boxStyles . sliderMarks } >
448+ < Box > { option . units } </ Box >
449+ < Box sx = { boxStyles . sliderPriceText } >
450+ { formatPrice ( isYearly ? option . yearlyPerUnit * option . units : option . monthlyPerUnit * option . units ) }
460451 </ Box >
461- )
462- } ) ) }
463- />
464-
452+ </ Box >
453+ ) ,
454+ } ) ) || [ ] }
455+ />
465456 </ Box >
466457 </ >
467- ) }
458+ ) }
468459 </ Box >
469460 </ CardContent >
470461 </ Card >
0 commit comments