use rmux_core::formats::{styled_text_width, truncate_styled_text_to_width};
use rmux_core::Utf8Config;
#[derive(Debug, Default, PartialEq, Eq)]
pub(super) struct StatusComponent {
pub(super) expanded: String,
pub(super) width: usize,
}
pub(super) fn truncate_status_component(
expanded: &str,
max_width: usize,
utf8: &Utf8Config,
) -> StatusComponent {
let expanded = truncate_styled_text_to_width(expanded, max_width, utf8);
let width = styled_text_width(&expanded, utf8);
StatusComponent { expanded, width }
}