Move UI & make a root model.

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-08-20 20:28:24 +02:00
parent e99f32ded8
commit e77eaf4e2c
12 changed files with 76 additions and 47 deletions
+40
View File
@@ -0,0 +1,40 @@
package ui
import (
"image/color"
"charm.land/lipgloss/v2"
"github.com/anotherhadi/ilovetui/style"
"github.com/anotherhadi/usbguard-tui/internal/guard"
)
var statusColors = map[guard.Status]color.Color{
guard.Allowed: style.S.Success,
guard.Blocked: style.S.Error,
guard.Rejected: style.S.Warning,
}
var statusColorsSelected = map[guard.Status]color.Color{
guard.Allowed: style.S.Success,
guard.Blocked: style.S.Error,
guard.Rejected: style.S.Warning,
}
var (
headerStyle = lipgloss.NewStyle().
Bold(true).
Foreground(style.S.Primary).
PaddingLeft(1)
daemonActiveStyle = lipgloss.NewStyle().Foreground(style.S.Success)
daemonOtherStyle = lipgloss.NewStyle().Foreground(style.S.Muted)
mutedStyle = lipgloss.NewStyle().Foreground(style.S.Muted)
infoLabelStyle = lipgloss.NewStyle().
Foreground(style.S.Muted).
PaddingLeft(1).
Width(16)
warnStyle = lipgloss.NewStyle().Foreground(style.S.Warning)
)