| 1 | use gpui_kit::component::v_flex; |
| 2 | use gpui_kit::*; |
| 3 | |
| 4 | use crate::data::Directory; |
| 5 | use crate::rows::StartInfo; |
| 6 | use crate::theme; |
| 7 | use crate::views::avatar::person_avatar; |
| 8 | |
| 9 | const NOTES_SPACE_TITLE: &str = "This is your space"; |
| 10 | const NOTES_SPACE_TEXT: &str = "This chat is just for you...with you. Use it for drafts, send files to yourself, or get to know chat features a little better."; |
| 11 | const NOTES_SPACE_AVATAR_SIZE: f32 = 72.; |
| 12 | const NOTES_SPACE_TEXT_WIDTH: f32 = 360.; |
| 13 | |
| 14 | pub(super) fn render_notes_space(directory: &Directory, start: &StartInfo) -> AnyElement { |
| 15 | v_flex() |
| 16 | .size_full() |
| 17 | .items_center() |
| 18 | .justify_center() |
| 19 | .gap(px(12.)) |
| 20 | .px(px(16.)) |
| 21 | .child(person_avatar( |
| 22 | directory, |
| 23 | start.user_id.as_deref(), |
| 24 | &start.avatar_name, |
| 25 | NOTES_SPACE_AVATAR_SIZE, |
| 26 | )) |
| 27 | .child( |
| 28 | v_flex() |
| 29 | .items_center() |
| 30 | .gap(px(4.)) |
| 31 | .max_w(px(NOTES_SPACE_TEXT_WIDTH)) |
| 32 | .child( |
| 33 | div() |
| 34 | .text_size(px(16.)) |
| 35 | .font_weight(FontWeight::BOLD) |
| 36 | .text_color(theme::text()) |
| 37 | .child(NOTES_SPACE_TITLE), |
| 38 | ) |
| 39 | .child( |
| 40 | div() |
| 41 | .text_center() |
| 42 | .text_size(px(13.)) |
| 43 | .text_color(theme::text_muted()) |
| 44 | .child(NOTES_SPACE_TEXT), |
| 45 | ), |
| 46 | ) |
| 47 | .into_any_element() |
| 48 | } |