@@ -57,6 +57,11 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
5757 return getAddOns ( ) ;
5858 } , [ ] ) ;
5959
60+ const formatLearners = ( learners ) => {
61+ if ( typeof learners === "string" ) return learners ;
62+ return learners . toLocaleString ( "en-US" ) ;
63+ } ;
64+
6065 // Helper function to render icons based on type
6166 const renderIcon = ( iconType ) => {
6267 switch ( iconType ) {
@@ -361,47 +366,36 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
361366 step = { null }
362367 sx = { getSliderStyle ( sliderStyles . base , "1rem" ) }
363368 marks = { ( ( ) => {
364- // Determine which sub-addon to show pricing for based on selection
365- let targetSubAddon = null ;
366- if ( selectedSubAddOns [ "academy-practical" ] ) {
367- targetSubAddon = selectedAddon ?. subAddOns ?. find ( sub => sub . id === "academy-practical" ) ;
368- } else {
369- targetSubAddon = selectedAddon ?. subAddOns ?. find ( sub => sub . id === "academy-theory" ) ;
370- }
371-
372- return targetSubAddon ?. pricing ?. map ( ( option , index ) => ( {
373- value : index ,
374- label : (
375- < Box sx = { { textAlign : "center" , fontSize : "1.25rem" , fontWeight : "bold" } } >
376- < Box > { option . learners === "2500+" ? "2,500+" : option . learners } </ Box >
377- { isYearly && (
378- < Box
379- sx = { {
380- fontSize : {
381- xs : "0.75rem" ,
382- sm : "0.9rem" ,
383- }
384- } }
385- >
386- { formatSliderPrice ( ( option . yearlyPerUser / 12 ) * ( selectedSubAddOns [ "academy-practical" ] ? 2 : 1 ) , currency ) } < br /> { targetSubAddon . unitLabelSingular } /month
387- </ Box >
388- ) }
389- < Box
390- sx = { {
391- color : "text.secondary" ,
392- mb : 1.5 ,
393- fontSize : {
394- xs : "0.75rem" ,
395- sm : "0.9rem" ,
396- }
397- } } >
398- { formatSliderPrice ( ( isYearly ? option . yearlyPerUser : option . monthlyPerUser ) * ( selectedSubAddOns [ "academy-practical" ] ? 2 : 1 ) , currency ) } < br /> { targetSubAddon . unitLabelSingular } /{ isYearly ? "year" : "month" }
399- </ Box >
400- </ Box >
401- ) ,
402- } ) ) || [ ] ;
403- } ) ( ) }
404- />
369+ let targetSubAddon = null ;
370+ if ( selectedSubAddOns [ "academy-practical" ] ) {
371+ targetSubAddon = selectedAddon ?. subAddOns ?. find ( sub => sub . id === "academy-practical" ) ;
372+ } else {
373+ targetSubAddon = selectedAddon ?. subAddOns ?. find ( sub => sub . id === "academy-theory" ) ;
374+ }
375+ return targetSubAddon ?. pricing ?. map ( ( option , index ) => ( {
376+ value : index ,
377+ label : (
378+ < Box sx = { { textAlign : "center" , fontSize : "1.25rem" , fontWeight : "bold" } } >
379+ < Box > { formatLearners ( option . learners ) } </ Box > { /* Changed from ternary */ }
380+ < Box
381+ sx = { {
382+ color : "text.secondary" ,
383+ mb : 1.5 ,
384+ fontSize : { xs : "0.75rem" , sm : "0.9rem" } ,
385+ } }
386+ >
387+ { formatSliderPrice (
388+ ( isYearly ? option . yearlyPerUser : option . monthlyPerUser ) * ( selectedSubAddOns [ "academy-practical" ] ? 2 : 1 ) ,
389+ currency
390+ ) }
391+ < br />
392+ { targetSubAddon . unitLabelSingular } /{ isYearly ? "year" : "month" }
393+ </ Box >
394+ </ Box >
395+ ) ,
396+ } ) ) || [ ] ;
397+ } ) ( ) }
398+ />
405399 < Box sx = { boxStyles . disclaimerSection } >
406400 < Typography variant = "body2" sx = { typographyStyles . italic } >
407401 Looking for a plan larger than 2,500 learners? Great! < a href = "/company/contact" > Let us know</ a > .
0 commit comments