File: ui.go

package info (click to toggle)
debpkg 0.0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80 kB
  • sloc: makefile: 33
file content (46 lines) | stat: -rw-r--r-- 944 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package ui

import (
	"fmt"
	"strings"

	"github.com/charmbracelet/lipgloss"
)

var (
	headerStyle = lipgloss.NewStyle().
		Bold(true).
		Foreground(lipgloss.Color("#00D7FF")).
		Background(lipgloss.Color("#1a1a1a")).
		Padding(0, 1).
		Margin(1, 0)

	boxStyle = lipgloss.NewStyle().
		Border(lipgloss.RoundedBorder()).
		BorderForeground(lipgloss.Color("#00D7FF")).
		Padding(1, 2).
		Margin(0, 1)
)

// ShowHeader displays a styled header
func ShowHeader(title string) {
	header := headerStyle.Render("📦 " + title)
	fmt.Println(header)
}

// ShowBox displays content in a styled box
func ShowBox(content string) {
	box := boxStyle.Render(content)
	fmt.Println(box)
}

// ShowSeparator displays a separator line
func ShowSeparator() {
	separator := strings.Repeat("─", 60)
	separatorStyle := lipgloss.NewStyle().
		Foreground(lipgloss.Color("#444444")).
		MarginTop(1).
		MarginBottom(1)

	fmt.Println(separatorStyle.Render(separator))
}