use gpui_kit::component::h_flex;
use gpui_kit::{
Div, FontWeight, Hsla, InteractiveElement as _, ParentElement as _, Role, SharedString,
Stateful, StatefulInteractiveElement as _, Styled as _, div, px,
};
use super::text_edge;
use crate::tokens::Tokens;
const TRAILING_PX: f32 = 8.;
pub(super) fn strip(id: &'static str, line: Hsla, tokens: &Tokens) -> Stateful<Div> {
h_flex()
.id(id)
.w_full()
.min_w_0()
.flex_shrink_0()
.min_h(tokens.strip_height)
.gap_1()
.pl(text_edge(tokens))
.pr(px(TRAILING_PX))
.border_b_1()
.border_color(line)
}
pub(super) fn capitals(label: &str) -> SharedString {
label.to_uppercase().into()
}
pub(super) fn title(
id: &'static str,
text: SharedString,
weight: FontWeight,
family: SharedString,
tokens: &Tokens,
) -> Stateful<Div> {
div()
.id(id)
.role(Role::Heading)
.aria_label(text.clone())
.flex_1()
.min_w_0()
.truncate()
.font_family(family)
.font_weight(weight)
.text_size(tokens.row_font)
.text_color(tokens.fg_strong)
.child(text)
}