| 1 | use gpui_kit::component::v_flex; |
| 2 | use gpui_kit::*; |
| 3 | use teams_core::ChatSection; |
| 4 | |
| 5 | use super::rows::{caption, toggle_row}; |
| 6 | use crate::app_state::AppState; |
| 7 | use crate::theme; |
| 8 | |
| 9 | pub fn render(app: &Entity<AppState>, cx: &App) -> Div { |
| 10 | let enabled = app |
| 11 | .read(cx) |
| 12 | .directory |
| 13 | .section_settings |
| 14 | .enabled(ChatSection::Muted); |
| 15 | let toggle_app = app.clone(); |
| 16 | v_flex().w_full().child(caption("CHAT LIST")).child( |
| 17 | toggle_row( |
| 18 | "settings-muted-section", |
| 19 | "Show muted items in their own section", |
| 20 | "Read from your Teams account", |
| 21 | theme::text_muted(), |
| 22 | enabled, |
| 23 | ) |
| 24 | .on_click(move |_, _, cx| { |
| 25 | toggle_app.update(cx, |state, cx| { |
| 26 | state.set_chat_section(ChatSection::Muted, !enabled, cx) |
| 27 | }) |
| 28 | }), |
| 29 | ) |
| 30 | } |