use askama::Template;

/// A project card on the root page — either healthy or failed.
pub(super) enum ProjectCard {
    Ok {
        name: String,
        open: usize,
        in_progress: usize,
        closed: usize,
        total: usize,
    },
    Err {
        name: String,
        error: String,
    },
}

#[derive(Template)]
#[template(path = "index.html")]
pub(super) struct IndexTemplate {
    pub(super) all_projects: Vec<String>,
    pub(super) active_project: Option<String>,
    pub(super) projects: Vec<ProjectCard>,
}
