@@ -248,6 +248,12 @@ function getPaymentPeriodDiscount(period: PaymentPeriod, paymentPeriod: Subscrip
248248 return 0
249249}
250250
251+ function getPaymentPeriodSuffix ( period : PaymentPeriod , paymentPeriod : SubscriptionConfigData [ "paymentPeriod" ] ) {
252+ if ( period === "quarterly" ) return paymentPeriod . quarterlyPeriodSuffix
253+ if ( period === "yearly" ) return paymentPeriod . yearlyPeriodSuffix
254+ return paymentPeriod . monthlyPeriodSuffix
255+ }
256+
251257export function SubscriptionConfigurator ( { locale, content, icons } : { locale : AppLocale ; content : SubscriptionConfigData ; icons : SubscriptionIcons } ) {
252258 const workflowExecutions = content . workflowExecutions
253259 const aiTokens = content . aiTokens
@@ -273,6 +279,7 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
273279 const aiTokenPrice = content . aiTokenPriceFactor * selection . aiTokens
274280 const additionalFeaturesPrice = Array . from ( selectedFeatures ) . reduce ( ( acc , idx ) => acc + ( content . additionalFeatures ?. [ idx ] ?. price ?? 0 ) , 0 )
275281 const paymentPeriodDiscount = getPaymentPeriodDiscount ( selection . paymentPeriod , content . paymentPeriod )
282+ const paymentPeriodSuffix = getPaymentPeriodSuffix ( selection . paymentPeriod , content . paymentPeriod )
276283 const totalBeforeDiscount = workflowExecutionPrice + aiTokenPrice + additionalFeaturesPrice
277284 const totalPrice = totalBeforeDiscount * ( 1 - paymentPeriodDiscount )
278285
@@ -388,17 +395,6 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
388395 < p className = "text-lg font-semibold tracking-wider text-white" > { workflowExecutions . title } </ p >
389396 < p className = "text-sm text-secondary" > { workflowExecutions . description } </ p >
390397 </ div >
391- < WorkflowCalculatorDialog
392- locale = { locale }
393- content = { content . workflowCalculator }
394- businessTypeIcons = { icons . workflowBusinessTypes }
395- value = { selection . workflowExecutions }
396- min = { workflowExecutionRange . min }
397- max = { workflowExecutionRange . max }
398- step = { workflowExecutionRange . step }
399- suffix = { workflowExecutions . suffix }
400- onApply = { ( workflowExecutionsValue ) => setSelection ( ( current ) => ( { ...current , workflowExecutions : workflowExecutionsValue } ) ) }
401- />
402398 </ div >
403399 < Slider
404400 min = { workflowExecutionRange . min }
@@ -409,12 +405,27 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
409405 ariaLabel = { workflowExecutions . title }
410406 className = "mt-4"
411407 valueLabelSuffix = { workflowExecutions . suffix }
408+ centerLabelSuffix = { paymentPeriodSuffix }
412409 />
413- < div className = "mt-2 flex flex-wrap items-center justify-end gap-2" >
414- < p className = "text-sm font-medium text-tertiary" > { content . contactSales . prompt } </ p >
415- < LinkButton href = { content . contactSales . href } className = "border-b-0 text-secondary" showArrow = { false } >
416- { content . contactSales . label }
417- </ LinkButton >
410+ < div className = "flex items-center w-full justify-between gap-4" >
411+ < WorkflowCalculatorDialog
412+ locale = { locale }
413+ content = { content . workflowCalculator }
414+ businessTypeIcons = { icons . workflowBusinessTypes }
415+ value = { selection . workflowExecutions }
416+ min = { workflowExecutionRange . min }
417+ max = { workflowExecutionRange . max }
418+ step = { workflowExecutionRange . step }
419+ suffix = { workflowExecutions . suffix }
420+ centerLabelSuffix = { paymentPeriodSuffix }
421+ onApply = { ( workflowExecutionsValue ) => setSelection ( ( current ) => ( { ...current , workflowExecutions : workflowExecutionsValue } ) ) }
422+ />
423+ < div className = "mt-2 flex flex-wrap items-center justify-end gap-2" >
424+ < p className = "text-sm font-medium text-tertiary" > { content . contactSales . prompt } </ p >
425+ < LinkButton href = { content . contactSales . href } className = "border-b-0 text-secondary" showArrow = { false } >
426+ { content . contactSales . label }
427+ </ LinkButton >
428+ </ div >
418429 </ div >
419430 </ div >
420431
@@ -434,6 +445,7 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
434445 ariaLabel = { aiTokens . title }
435446 className = "mt-4"
436447 valueLabelSuffix = { aiTokens . suffix }
448+ centerLabelSuffix = { paymentPeriodSuffix }
437449 />
438450 </ div >
439451
0 commit comments