unavailable_editing_tooltip.rs

 1use gpui::{Context, IntoElement, Render, Window};
 2use ui::{prelude::*, tooltip_container};
 3
 4pub struct UnavailableEditingTooltip {
 5    agent_name: SharedString,
 6}
 7
 8impl UnavailableEditingTooltip {
 9    pub fn new(agent_name: SharedString) -> Self {
10        Self { agent_name }
11    }
12}
13
14impl Render for UnavailableEditingTooltip {
15    fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
16        tooltip_container(cx, |this, _| {
17            this.child(Label::new("Unavailable Editing")).child(
18                div().max_w_64().child(
19                    Label::new(format!(
20                        "Editing previous messages is not available for {} yet.",
21                        self.agent_name
22                    ))
23                    .size(LabelSize::Small)
24                    .color(Color::Muted),
25                ),
26            )
27        })
28    }
29}