icon.rs

 1use gpui::{Div, Render};
 2use story::Story;
 3use strum::IntoEnumIterator;
 4
 5use crate::prelude::*;
 6use crate::{Icon, IconElement};
 7
 8pub struct IconStory;
 9
10impl Render for IconStory {
11    type Element = Div;
12
13    fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
14        let icons = Icon::iter();
15
16        Story::container()
17            .child(Story::title_for::<IconElement>())
18            .child(Story::label("All Icons"))
19            .child(div().flex().gap_3().children(icons.map(IconElement::new)))
20    }
21}