Skip to content

Commit

Permalink
feat: Add padding
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjohiryan committed Jun 3, 2024
1 parent a61c44b commit 017c6c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/lipgloss/table"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
)
Expand All @@ -34,6 +35,12 @@ var neoFetchCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
lipgloss.SetColorProfile(termenv.TrueColor)

baseStyle := lipgloss.NewStyle().
PaddingTop(1).
PaddingRight(4).
PaddingBottom(1).
PaddingLeft(4)

var (
b strings.Builder
lines = strings.Split(art, "\n")
Expand All @@ -47,7 +54,12 @@ var neoFetchCmd = &cobra.Command{
b.WriteRune('\n')
}

fmt.Print(b.String())
t := table.New().
Border(lipgloss.HiddenBorder())

t.Row(baseStyle.Render(b.String()), baseStyle.Render("System Info goes here"))

fmt.Print(t)

return nil
},
Expand Down

0 comments on commit 017c6c6

Please sign in to comment.