This commit is contained in:
2026-09-04 17:23:10 +07:00
parent 1496b7afeb
commit 15c2122f38
13 changed files with 63 additions and 46 deletions
@@ -30,8 +30,9 @@ fn announcement_rows(announcement: &Announcement, cx: &App) -> AnyElement {
text(
announcement
.name
.clone()
.unwrap_or_else(|| SharedString::from("")),
.as_deref()
.map(SharedString::from)
.unwrap_or_else(|| SharedString::from("-")),
),
cx,
));
@@ -41,8 +42,9 @@ fn announcement_rows(announcement: &Announcement, cx: &App) -> AnyElement {
text(
announcement
.description
.clone()
.unwrap_or_else(|| SharedString::from("")),
.as_deref()
.map(SharedString::from)
.unwrap_or_else(|| SharedString::from("-")),
),
cx,
));
@@ -131,7 +133,12 @@ fn row(label: &'static str, value: AnyElement, cx: &App) -> AnyElement {
}
/// Plain text value, wrapping within the dialog.
fn text(value: SharedString) -> AnyElement {
fn text<T>(value: T) -> AnyElement
where
T: Into<SharedString>,
{
let value = value.into();
div()
.text_sm()
.w_full()