@@ -561,74 +561,70 @@ export function TierHobby({
561
561
< TierLimit href = "https://trigger.dev/pricing#computePricing" >
562
562
${ plan . limits . includedUsage / 100 } usage included
563
563
</ TierLimit >
564
- < Form action = { formAction } method = "post" id = "subscribe" >
565
- < div className = "py-6" >
566
- < input type = "hidden" name = "type" value = "paid" />
567
- < input type = "hidden" name = "planCode" value = { plan . code } />
568
- < input type = "hidden" name = "callerPath" value = { location . pathname } />
569
- { subscription ?. plan !== undefined &&
570
- subscription . plan . type !== "free" &&
571
- subscription . canceledAt === undefined &&
572
- subscription . plan . code !== plan . code ? (
573
- < Dialog open = { isDialogOpen } onOpenChange = { setIsDialogOpen } >
574
- < DialogTrigger asChild >
575
- < Button variant = "tertiary/large" fullWidth className = "text-md font-medium" >
564
+ < Form action = { formAction } method = "post" id = "subscribe-hobby" className = "py-6" >
565
+ < input type = "hidden" name = "type" value = "paid" />
566
+ < input type = "hidden" name = "planCode" value = { plan . code } />
567
+ < input type = "hidden" name = "callerPath" value = { location . pathname } />
568
+ { subscription ?. plan !== undefined &&
569
+ subscription . plan . type !== "free" &&
570
+ subscription . canceledAt === undefined &&
571
+ subscription . plan . code !== plan . code ? (
572
+ < Dialog open = { isDialogOpen } onOpenChange = { setIsDialogOpen } >
573
+ < DialogTrigger asChild >
574
+ < Button variant = "tertiary/large" fullWidth className = "text-md font-medium" >
575
+ { `Downgrade to ${ plan . title } ` }
576
+ </ Button >
577
+ </ DialogTrigger >
578
+ < DialogContent className = "sm:max-w-md" >
579
+ < DialogHeader > Downgrade plan</ DialogHeader >
580
+ < div className = "mb-2 mt-4 flex items-start gap-3" >
581
+ < span >
582
+ < ArrowDownCircleIcon className = "size-12 text-blue-500" />
583
+ </ span >
584
+ < Paragraph variant = "base/bright" className = "text-text-bright" >
585
+ By downgrading you will lose access to your current plan’s features and your
586
+ included credits will be reduced.
587
+ </ Paragraph >
588
+ </ div >
589
+ < DialogFooter >
590
+ < Button variant = "tertiary/medium" onClick = { ( ) => setIsDialogOpen ( false ) } >
591
+ Dismiss
592
+ </ Button >
593
+ < Button
594
+ variant = "tertiary/medium"
595
+ disabled = { isLoading }
596
+ LeadingIcon = {
597
+ isLoading && "submitting" ? ( ) => < Spinner color = "white" /> : undefined
598
+ }
599
+ form = "subscribe-hobby"
600
+ >
576
601
{ `Downgrade to ${ plan . title } ` }
577
602
</ Button >
578
- </ DialogTrigger >
579
- < DialogContent className = "sm:max-w-md" >
580
- < DialogHeader > Downgrade plan</ DialogHeader >
581
- < div className = "mb-2 mt-4 flex items-start gap-3" >
582
- < span >
583
- < ArrowDownCircleIcon className = "size-12 text-blue-500" />
584
- </ span >
585
- < Paragraph variant = "base/bright" className = "text-text-bright" >
586
- By downgrading you will lose access to your current plan’s features and your
587
- included credits will be reduced.
588
- </ Paragraph >
589
- </ div >
590
- < DialogFooter >
591
- < Button variant = "tertiary/medium" onClick = { ( ) => setIsDialogOpen ( false ) } >
592
- Dismiss
593
- </ Button >
594
- < Button
595
- variant = "tertiary/medium"
596
- disabled = { isLoading }
597
- LeadingIcon = {
598
- isLoading && "submitting" ? ( ) => < Spinner color = "white" /> : undefined
599
- }
600
- form = "subscribe"
601
- >
602
- { `Downgrade to ${ plan . title } ` }
603
- </ Button >
604
- </ DialogFooter >
605
- </ DialogContent >
606
- </ Dialog >
607
- ) : (
608
- < Button
609
- variant = { isHighlighted ? "primary/large" : "tertiary/large" }
610
- fullWidth
611
- className = "text-md font-medium"
612
- disabled = {
613
- isLoading ||
614
- ( subscription ?. plan ?. code === plan . code && subscription . canceledAt === undefined )
615
- }
616
- LeadingIcon = {
617
- isLoading && navigation . formData ?. get ( "planCode" ) === plan . code
618
- ? Spinner
619
- : undefined
620
- }
621
- >
622
- { subscription ?. plan === undefined
623
- ? "Select plan"
624
- : subscription . plan . type === "free" || subscription . canceledAt !== undefined
625
- ? `Upgrade to ${ plan . title } `
626
- : subscription . plan . code === plan . code
627
- ? "Current plan"
628
- : `Upgrade to ${ plan . title } ` }
629
- </ Button >
630
- ) }
631
- </ div >
603
+ </ DialogFooter >
604
+ </ DialogContent >
605
+ </ Dialog >
606
+ ) : (
607
+ < Button
608
+ variant = { isHighlighted ? "primary/large" : "tertiary/large" }
609
+ fullWidth
610
+ className = "text-md font-medium"
611
+ disabled = {
612
+ isLoading ||
613
+ ( subscription ?. plan ?. code === plan . code && subscription . canceledAt === undefined )
614
+ }
615
+ LeadingIcon = {
616
+ isLoading && navigation . formData ?. get ( "planCode" ) === plan . code ? Spinner : undefined
617
+ }
618
+ >
619
+ { subscription ?. plan === undefined
620
+ ? "Select plan"
621
+ : subscription . plan . type === "free" || subscription . canceledAt !== undefined
622
+ ? `Upgrade to ${ plan . title } `
623
+ : subscription . plan . code === plan . code
624
+ ? "Current plan"
625
+ : `Upgrade to ${ plan . title } ` }
626
+ </ Button >
627
+ ) }
632
628
</ Form >
633
629
< ul className = "flex flex-col gap-2.5" >
634
630
< ConcurrentRuns limits = { plan . limits } />
0 commit comments