use crate::nav::convs::ConvBall;
use crate::nav::convs::group::ConvGroup;
use crate::theme;
pub(super) fn row_badge(ui: &mut egui::Ui, ball: &ConvBall) {
let label = format!("◈{}", ball.id);
match ball.state {
Some(s) => ui.colored_label(theme::ball_hue(s), label),
None => ui.weak(label),
};
}
pub(super) fn group_header(ui: &mut egui::Ui, group: &ConvGroup) {
let Some(ball) = &group.ball else {
ui.weak("◈ unassociated");
return;
};
let label = format!("◈ {}", ball.id);
ui.horizontal(|ui| {
match ball.state {
Some(s) => ui.colored_label(theme::ball_hue(s), label),
None => ui.weak(label),
};
if let Some(badge) = &ball.badge {
ui.weak(badge);
}
});
}
pub(super) fn header_ball(ui: &mut egui::Ui, ball: &ConvBall) {
let label = match &ball.title {
Some(t) => format!("◈ {} · {t}", ball.id),
None => format!("◈ {}", ball.id),
};
ui.horizontal(|ui| {
match ball.state {
Some(s) => ui.colored_label(theme::ball_hue(s), label),
None => ui.weak(label),
};
if let Some(badge) = &ball.badge {
ui.weak(badge);
}
});
}