//! Top header bar — displays the app title and basic status.

use crate::theme;
use iced::widget::{container, row, text};
use iced::{Element, Length};

/// Build the header bar element.
pub fn view<'a, Message: 'a>(line_count: usize) -> Element<'a, Message> {
    let title = text("CalcPad").size(14);
    let status = text(format!("{} lines", line_count))
        .size(12)
        .color(theme::PLACEHOLDER);

    container(
        row![title, iced::widget::horizontal_space(), status]
            .padding([6, 12])
            .align_y(iced::Alignment::Center),
    )
    .width(Length::Fill)
    .style(theme::header_bar)
    .into()
}
