Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T05:07:33.775Z 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

profile_modal_header.rs

43 lines · 1.2 KB · rust
1use ui::prelude::*;
2
3#[derive(IntoElement)]
4pub struct ProfileModalHeader {
5    label: SharedString,
6    icon: Option<IconName>,
7}
8
9impl ProfileModalHeader {
10    pub fn new(label: impl Into<SharedString>, icon: Option<IconName>) -> Self {
11        Self {
12            label: label.into(),
13            icon,
14        }
15    }
16}
17
18impl RenderOnce for ProfileModalHeader {
19    fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
20        let mut container = h_flex()
21            .w_full()
22            .px(DynamicSpacing::Base12.rems(cx))
23            .pt(DynamicSpacing::Base08.rems(cx))
24            .pb(DynamicSpacing::Base04.rems(cx))
25            .rounded_t_sm()
26            .gap_1p5();
27
28        if let Some(icon) = self.icon {
29            container = container.child(Icon::new(icon).size(IconSize::XSmall).color(Color::Muted));
30        }
31
32        container.child(
33            h_flex().gap_1().overflow_x_hidden().child(
34                div()
35                    .max_w_96()
36                    .overflow_x_hidden()
37                    .text_ellipsis()
38                    .child(Headline::new(self.label).size(HeadlineSize::XSmall)),
39            ),
40        )
41    }
42}
43
Served at tenant.openagents/omega Member data and write actions are omitted.