1use gpui::{prelude::*, Render, View};
2use story::Story;
3use strum::IntoEnumIterator;
4use ui::prelude::*;
5
6use crate::story_selector::ComponentStory;
7
8pub struct KitchenSinkStory;
9
10impl KitchenSinkStory {
11 pub fn view(cx: &mut WindowContext) -> View<Self> {
12 cx.new_view(|_cx| Self)
13 }
14}
15
16impl Render for KitchenSinkStory {
17 fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
18 let component_stories = ComponentStory::iter()
19 .map(|selector| selector.story(cx))
20 .collect::<Vec<_>>();
21
22 Story::container()
23 .id("kitchen-sink")
24 .overflow_y_scroll()
25 .child(Story::title("Kitchen Sink"))
26 .child(Story::label("Components"))
27 .child(div().flex().flex_col().children(component_stories))
28 // Add a bit of space at the bottom of the kitchen sink so elements
29 // don't end up squished right up against the bottom of the screen.
30 .child(div().p_4())
31 }
32}