diff --git a/apps/web/components/header.tsx b/apps/web/components/header.tsx index fd81bf52..ea40bd62 100644 --- a/apps/web/components/header.tsx +++ b/apps/web/components/header.tsx @@ -15,6 +15,7 @@ import { LifeBuoy, LayoutGrid, ChevronRight, + Zap, } from "lucide-react" import { Button } from "@ui/components/button" import { cn } from "@lib/utils" @@ -352,6 +353,15 @@ export function Header({ onAddMemory, onOpenSearch }: HeaderProps) { "linear-gradient(180deg, #0A0E14 0%, #05070A 100%)", }} > + + + + Upgrade + + ) : ( <> + + + + + + Upgrade + + + + + Upgrade + + + + {plan.name} + + + + + {plan.price} + + {plan.period ? ( + {plan.period} + ) : null} + + + + {plan.description} + + + + + + + {plan.credits} + + + of usage included + + + + + + {plan.features.map((feature) => ( + + + {feature} + + ))} + + + {action} + + ) +} + function Pill({ children, tone = "muted", @@ -490,6 +607,74 @@ export default function Billing() { }) } + const getPlanCardAction = (plan: PlanCardDefinition) => { + if (plan.id === "free") { + return ( + + {hasPaidPlan ? "Included with current plan" : "Your current plan"} + + ) + } + + if (currentPlan === "pro") { + return ( + + Your current plan + + ) + } + + if (currentPlan === "scale" || currentPlan === "enterprise") { + return ( + + Included with {planDisplayNames[currentPlan]} + + ) + } + + return ( + + {isUpgrading || isCheckingStatus || autumn.isLoading ? ( + + ) : null} + Upgrade to Pro + + ) + } + return ( @@ -694,6 +879,31 @@ export default function Billing() { + + + Plans + + All plans include usage-metered access. Top-ups roll over with paid + plans. + + + + {PLAN_CARDS.map((plan) => ( + + ))} + + + Credits
+ {plan.name} +
+ {plan.description} +
+ {plan.credits} +
+ of usage included +
+ All plans include usage-metered access. Top-ups roll over with paid + plans. +