first draft of miasma installer

This commit is contained in:
tumillanino
2025-10-18 17:13:02 +11:00
commit 8f054b63a1
8 changed files with 335 additions and 0 deletions

46
tui/steps/welcome.go Normal file
View File

@@ -0,0 +1,46 @@
package steps
import (
"miasma-installer/tui/styles"
tea "github.com/charmbracelet/bubbletea"
)
type WelcomeModel struct {
Finished bool
}
func NewWelcomeModel() WelcomeModel {
return WelcomeModel{Finished: false}
}
func (m WelcomeModel) Init() tea.Cmd {
return nil
}
func (m WelcomeModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if m.Finished {
return m, nil
}
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "enter":
m.Finished = true
}
}
return m, nil
}
func (m WelcomeModel) View() string {
s := styles.TitleStyle.Render("Welcome to the Miasma OS Installer")
s += "\n\n"
s += "This program will guide you through installing Miasma OS. \n"
s += "Please ensure that you have backed up any important data before proceding"
s += "\n\n"
s += styles.HelpStyle.Render("Press [Enter] to continue")
s += styles.HelpStyle.Render("Press [Ctrl+C] to exit")
return styles.MainStyle.Render(s)
}