Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T02:56:41.833Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

plan_chip.rs

46 lines · 1.4 KB · rust
1use cloud_api_types::Plan;
2use ui::{Chip, prelude::*};
3
4/// A [`Chip`] that displays a [`Plan`].
5#[derive(IntoElement)]
6pub struct PlanChip {
7    plan: Plan,
8}
9
10impl PlanChip {
11    pub fn new(plan: Plan) -> Self {
12        Self { plan }
13    }
14}
15
16impl RenderOnce for PlanChip {
17    fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
18        let free_chip_bg = cx
19            .theme()
20            .colors()
21            .editor_background
22            .opacity(0.5)
23            .blend(cx.theme().colors().text_accent.opacity(0.05));
24
25        let pro_chip_bg = cx
26            .theme()
27            .colors()
28            .editor_background
29            .opacity(0.5)
30            .blend(cx.theme().colors().text_accent.opacity(0.2));
31
32        let (plan_name, label_color, bg_color) = match self.plan {
33            Plan::ZedFree => ("Free", Color::Default, free_chip_bg),
34            Plan::ZedProTrial => ("Pro Trial", Color::Accent, pro_chip_bg),
35            Plan::ZedPro => ("Pro", Color::Accent, pro_chip_bg),
36            Plan::ZedBusiness => ("Business", Color::Accent, pro_chip_bg),
37            Plan::ZedVip => ("VIP", Color::Accent, pro_chip_bg),
38            Plan::ZedStudent => ("Student", Color::Accent, pro_chip_bg),
39        };
40
41        Chip::new(plan_name.to_string())
42            .bg_color(bg_color)
43            .label_color(label_color)
44    }
45}
46
Served at tenant.openagents/omega Member data and write actions are omitted.