young_account_banner.rs

 1use gpui::{IntoElement, ParentElement};
 2use ui::{Banner, prelude::*};
 3
 4#[derive(IntoElement)]
 5pub struct YoungAccountBanner;
 6
 7impl RenderOnce for YoungAccountBanner {
 8    fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
 9        const YOUNG_ACCOUNT_DISCLAIMER: &str = "Given your GitHub account was created less than 30 days ago, we cannot put you in the Free plan or offer you a free trial of the Pro plan. We hope you'll understand, as this is unfortunately required to prevent abuse of our service. To continue, upgrade to Pro or use your own API keys for other providers.";
10
11        let label = div()
12            .w_full()
13            .text_sm()
14            .text_color(cx.theme().colors().text_muted)
15            .child(YOUNG_ACCOUNT_DISCLAIMER);
16
17        div()
18            .my_1()
19            .child(Banner::new().severity(ui::Severity::Warning).child(label))
20    }
21}