1use gpui::{IntoElement, ParentElement};
2use ui::{List, ListBulletItem, prelude::*};
3
4/// Centralized definitions for Zed AI plans
5pub struct PlanDefinitions;
6
7impl PlanDefinitions {
8 pub const AI_DESCRIPTION: &'static str = "Zed offers a complete agentic experience, with robust editing and reviewing features to collaborate with AI.";
9
10 pub fn free_plan(&self, is_v2: bool) -> impl IntoElement {
11 if is_v2 {
12 List::new()
13 .child(ListBulletItem::new("2,000 accepted edit predictions"))
14 .child(ListBulletItem::new(
15 "Unlimited prompts with your AI API keys",
16 ))
17 .child(ListBulletItem::new(
18 "Unlimited use of external agents like Claude Code",
19 ))
20 } else {
21 List::new()
22 .child(ListBulletItem::new("50 prompts with Claude models"))
23 .child(ListBulletItem::new("2,000 accepted edit predictions"))
24 }
25 }
26
27 pub fn pro_trial(&self, is_v2: bool, period: bool) -> impl IntoElement {
28 if is_v2 {
29 List::new()
30 .child(ListBulletItem::new("Unlimited edit predictions"))
31 .child(ListBulletItem::new("$20 of tokens"))
32 .when(period, |this| {
33 this.child(ListBulletItem::new(
34 "Try it out for 14 days, no credit card required",
35 ))
36 })
37 } else {
38 List::new()
39 .child(ListBulletItem::new("150 prompts with Claude models"))
40 .child(ListBulletItem::new(
41 "Unlimited edit predictions with Zeta, our open-source model",
42 ))
43 .when(period, |this| {
44 this.child(ListBulletItem::new(
45 "Try it out for 14 days, no credit card required",
46 ))
47 })
48 }
49 }
50
51 pub fn pro_plan(&self, is_v2: bool, price: bool) -> impl IntoElement {
52 if is_v2 {
53 List::new()
54 .child(ListBulletItem::new("Unlimited edit predictions"))
55 .child(ListBulletItem::new("$5 of tokens"))
56 .child(ListBulletItem::new("Usage-based billing beyond $5"))
57 } else {
58 List::new()
59 .child(ListBulletItem::new("500 prompts with Claude models"))
60 .child(ListBulletItem::new(
61 "Unlimited edit predictions with Zeta, our open-source model",
62 ))
63 .when(price, |this| {
64 this.child(ListBulletItem::new("$20 USD per month"))
65 })
66 }
67 }
68}