pub mod installation_progress { use eframe::egui::{Ui, ProgressBar, Color32}; use crate::app::SinfarInstallerApp; use crate::ui::format_duration; pub fn render(ui: &mut Ui, app: &mut SinfarInstallerApp) { ui.heading("Installing Sinfar Custom Content"); ui.add_space(10.0); ui.vertical(|ui| { ui.horizontal(|ui| { ui.label("Extracting files:"); ui.add(ProgressBar::new(app.extraction_progress).show_percentage()); }); if let Ok(state) = app.download_state.lock() { if state.completed { ui.colored_label(Color32::GREEN, "Installation Complete"); } else if app.extraction_progress > 0.0 && app.extraction_progress < 1.0 { ui.horizontal(|ui| { ui.label(format_duration(state.estimated_remaining)); }); } } }); if let Some(error) = &app.install_error { ui.colored_label(Color32::RED, error); if ui.button("Retry").clicked() { app.install_error = None; app.start_installation(); } } } }