29 lines
902 B
Rust
29 lines
902 B
Rust
use gpui::{Context, IntoElement, Render, Window};
|
|
use ui::{prelude::*, tooltip_container};
|
|
|
|
pub struct UnavailableEditingTooltip {
|
|
agent_name: SharedString,
|
|
}
|
|
|
|
impl UnavailableEditingTooltip {
|
|
pub fn new(agent_name: SharedString) -> Self {
|
|
Self { agent_name }
|
|
}
|
|
}
|
|
|
|
impl Render for UnavailableEditingTooltip {
|
|
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
|
tooltip_container(window, cx, |this, _, _| {
|
|
this.child(Label::new("Unavailable Editing")).child(
|
|
div().max_w_64().child(
|
|
Label::new(format!(
|
|
"Editing previous messages is not available for {} yet.",
|
|
self.agent_name
|
|
))
|
|
.size(LabelSize::Small)
|
|
.color(Color::Muted),
|
|
),
|
|
)
|
|
})
|
|
}
|
|
}
|