
This PR refactors the callout component and improves how we display errors and warnings in the agent panel, along with improvements for specific cases (e.g., you have `zed.dev` as your LLM provider and is signed out). Still a work in progress, though, wrapping up some details. Release Notes: - N/A
22 lines
782 B
Rust
22 lines
782 B
Rust
use gpui::{IntoElement, ParentElement};
|
|
use ui::{Banner, prelude::*};
|
|
|
|
#[derive(IntoElement)]
|
|
pub struct YoungAccountBanner;
|
|
|
|
impl RenderOnce for YoungAccountBanner {
|
|
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
|
const YOUNG_ACCOUNT_DISCLAIMER: &str = "To prevent abuse of our service, we cannot offer plans to GitHub accounts created fewer than 30 days ago. To request an exception, reach out to billing-support@zed.dev.";
|
|
|
|
let label = div()
|
|
.w_full()
|
|
.text_sm()
|
|
.text_color(cx.theme().colors().text_muted)
|
|
.child(YOUNG_ACCOUNT_DISCLAIMER);
|
|
|
|
div()
|
|
.max_w_full()
|
|
.my_1()
|
|
.child(Banner::new().severity(Severity::Warning).child(label))
|
|
}
|
|
}
|