diff --git a/crates/agent/src/ui/preview/usage_callouts.rs b/crates/agent/src/ui/preview/usage_callouts.rs index 6ebe0fdd88ee3f53f1851f8b42274d88b35ac44d..e08bf34d7b9bb990084e7352ab40f4f525019db6 100644 --- a/crates/agent/src/ui/preview/usage_callouts.rs +++ b/crates/agent/src/ui/preview/usage_callouts.rs @@ -1,3 +1,4 @@ +use client::zed_urls; use component::{empty_example, example_group_with_title, single_example}; use gpui::{AnyElement, App, IntoElement, RenderOnce, Window}; use language_model::RequestUsage; @@ -17,7 +18,7 @@ impl UsageCallout { } impl RenderOnce for UsageCallout { - fn render(self, _window: &mut Window, _cx: &mut App) -> impl IntoElement { + fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement { let (is_limit_reached, is_approaching_limit, remaining) = match self.usage.limit { UsageLimit::Limited(limit) => { let percentage = self.usage.amount as f32 / limit as f32; @@ -43,40 +44,38 @@ impl RenderOnce for UsageCallout { "Upgrade to continue, wait for the next reset, or switch to API key." .to_string(), "Upgrade", - "https://zed.dev/pricing", + zed_urls::account_url(cx), ), Plan::ZedProTrial => ( "Out of trial prompts", "Upgrade to Zed Pro to continue, or switch to API key.".to_string(), "Upgrade", - "https://zed.dev/pricing", + zed_urls::account_url(cx), ), Plan::ZedPro => ( "Out of included prompts", - "Enable usage based billing to continue.".to_string(), + "Enable usage-based billing to continue.".to_string(), "Manage", - "https://zed.dev/account", + zed_urls::account_url(cx), ), } } else { match self.plan { Plan::Free => ( - "Reaching Free tier limit soon", + "Reaching free plan limit soon", format!( - "{} remaining - Upgrade to increase limit, or switch providers", - remaining + "{remaining} remaining - Upgrade to increase limit, or switch providers", ), "Upgrade", - "https://zed.dev/pricing", + zed_urls::account_url(cx), ), Plan::ZedProTrial => ( - "Reaching Trial limit soon", + "Reaching trial limit soon", format!( - "{} remaining - Upgrade to increase limit, or switch providers", - remaining + "{remaining} remaining - Upgrade to increase limit, or switch providers", ), "Upgrade", - "https://zed.dev/pricing", + zed_urls::account_url(cx), ), _ => return div().into_any_element(), } @@ -98,7 +97,7 @@ impl RenderOnce for UsageCallout { icon, button_text, Box::new(move |_, _, cx| { - cx.open_url(url); + cx.open_url(&url); }), ) .into_any_element()