@@ -165,10 +165,10 @@ function PaymentPeriodSwitch({ content, locale, value, onChange }: PaymentPeriod
165165 onClick = { ( ) => onChange ( option . value ) }
166166 className = { cn ( "relative z-10 min-w-0 rounded-xl px-3 py-2 text-sm font-medium transition-colors" , active ? "text-white" : "text-secondary hover:text-white" ) }
167167 >
168- < span className = "inline-flex min-w-0 items-center justify-center gap-2 " >
168+ < span className = "inline-flex min-w-0 items-center justify-center gap-1 " >
169169 < span className = "min-w-0 truncate" > { content [ option . textKey ] } </ span >
170170 { discount > 0 ? (
171- < span className = { cn ( "shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none bg-brand/15 text-brand" ) } >
171+ < span className = { cn ( "shrink-0 rounded-full -mt-3 px-1 py-0.5 text-[10px] tracking-wider leading-none bg-brand/15 text-brand" ) } >
172172 -{ formatDiscountBadge ( discount , locale ) }
173173 </ span >
174174 ) : null }
@@ -235,10 +235,6 @@ function clampToRange(value: number, range: UsageRange) {
235235 return Math . min ( Math . max ( value , range . min ) , range . max )
236236}
237237
238- function formatUsageLabel ( value : number , suffix : string , locale : AppLocale ) {
239- return `${ value . toLocaleString ( locale ) } ${ suffix } `
240- }
241-
242238function formatDiscountBadge ( discount : number , locale : AppLocale ) {
243239 return new Intl . NumberFormat ( locale === "de" ? "de-DE" : "en-US" , {
244240 style : "percent" ,
@@ -255,13 +251,18 @@ function getPaymentPeriodDiscount(period: PaymentPeriod, paymentPeriod: Subscrip
255251export function SubscriptionConfigurator ( { locale, content, icons } : { locale : AppLocale ; content : SubscriptionConfigData ; icons : SubscriptionIcons } ) {
256252 const workflowExecutions = content . workflowExecutions
257253 const aiTokens = content . aiTokens
254+ const defaultSelection = content . defaults
255+ const defaultWorkflowExecutionRange = workflowExecutions [ defaultSelection . customerType ]
256+ const defaultAiTokenRange = aiTokens [ defaultSelection . customerType ]
257+ const defaultWorkflowExecutions = defaultSelection . workflowExecutions [ defaultSelection . customerType ]
258+ const defaultAiTokens = defaultSelection . aiTokens [ defaultSelection . customerType ]
258259
259260 const [ selection , setSelection ] = useState < SubscriptionSelection > ( {
260- deployment : "self-hosted" ,
261- customerType : "b2b" ,
262- paymentPeriod : "monthly" ,
263- workflowExecutions : 1000 ,
264- aiTokens : 1000000 ,
261+ deployment : defaultSelection . deployment ,
262+ customerType : defaultSelection . customerType ,
263+ paymentPeriod : defaultSelection . paymentPeriod ,
264+ workflowExecutions : clampToRange ( defaultWorkflowExecutions , defaultWorkflowExecutionRange ) ,
265+ aiTokens : clampToRange ( defaultAiTokens , defaultAiTokenRange ) ,
265266 } )
266267 const workflowExecutionRange = workflowExecutions [ selection . customerType ]
267268 const aiTokenRange = aiTokens [ selection . customerType ]
@@ -407,9 +408,7 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
407408 onChange = { ( workflowExecutionsValue ) => setSelection ( ( current ) => ( { ...current , workflowExecutions : workflowExecutionsValue } ) ) }
408409 ariaLabel = { workflowExecutions . title }
409410 className = "mt-4"
410- minLabel = { formatUsageLabel ( workflowExecutionRange . min , workflowExecutions . suffix , locale ) }
411- centerLabel = { formatUsageLabel ( selection . workflowExecutions , workflowExecutions . suffix , locale ) }
412- maxLabel = { formatUsageLabel ( workflowExecutionRange . max , workflowExecutions . suffix , locale ) }
411+ valueLabelSuffix = { workflowExecutions . suffix }
413412 />
414413 < div className = "mt-2 flex flex-wrap items-center justify-end gap-2" >
415414 < p className = "text-sm font-medium text-tertiary" > { content . contactSales . prompt } </ p >
@@ -434,9 +433,7 @@ export function SubscriptionConfigurator({ locale, content, icons }: { locale: A
434433 onChange = { ( aiTokensValue ) => setSelection ( ( current ) => ( { ...current , aiTokens : aiTokensValue } ) ) }
435434 ariaLabel = { aiTokens . title }
436435 className = "mt-4"
437- minLabel = { formatUsageLabel ( aiTokenRange . min , aiTokens . suffix , locale ) }
438- centerLabel = { formatUsageLabel ( selection . aiTokens , aiTokens . suffix , locale ) }
439- maxLabel = { formatUsageLabel ( aiTokenRange . max , aiTokens . suffix , locale ) }
436+ valueLabelSuffix = { aiTokens . suffix }
440437 />
441438 </ div >
442439
0 commit comments