use gpui::AnyElement; use smallvec::SmallVec; use crate::prelude::*; #[derive(IntoElement)] pub struct SettingsContainer { children: SmallVec<[AnyElement; 2]>, } impl SettingsContainer { pub fn new() -> Self { Self { children: SmallVec::new(), } } } impl ParentElement for SettingsContainer { fn extend(&mut self, elements: impl IntoIterator) { self.children.extend(elements) } } impl RenderOnce for SettingsContainer { fn render(self, cx: &mut WindowContext) -> impl IntoElement { v_flex() .elevation_2(cx) .px_2() .gap_1() .children(self.children) } }