@@ -82,41 +82,30 @@ func Title(title string, width int) string {
84type StatusOpts struct {
84type StatusOpts struct {
85− Icon string
85+ Icon string // if empty no icon will be shown
86− IconColor color.Color
87− NoIcon bool // If true, no icon will be displayed
88 Title string
86 Title string
89 TitleColor color.Color
87 TitleColor color.Color
90 Description string
88 Description string
91 DescriptionColor color.Color
89 DescriptionColor color.Color
92− ExtraContent string // Additional content to append after the description
90+ ExtraContent string // additional content to append after the description
95−func Status(ops StatusOpts, width int) string {
93+func Status(opts StatusOpts, width int) string {
96 t := styles.CurrentTheme()
94 t := styles.CurrentTheme()
97− icon := "●"
95+ icon := opts.Icon
98− iconColor := t.Success
101− } else if ops.NoIcon {
104− if ops.IconColor != nil {
105− iconColor = ops.IconColor
107− title := ops.Title
96+ title := opts.Title
108 titleColor := t.FgMuted
97 titleColor := t.FgMuted
109− if ops.TitleColor != nil {
98+ if opts.TitleColor != nil {
110− titleColor = ops.TitleColor
99+ titleColor = opts.TitleColor
112− description := ops.Description
101+ description := opts.Description
113 descriptionColor := t.FgSubtle
102 descriptionColor := t.FgSubtle
114− if ops.DescriptionColor != nil {
103+ if opts.DescriptionColor != nil {
115− descriptionColor = ops.DescriptionColor
104+ descriptionColor = opts.DescriptionColor
117 title = t.S().Base.Foreground(titleColor).Render(title)
106 title = t.S().Base.Foreground(titleColor).Render(title)
118 if description != "" {
107 if description != "" {
119− extraContentWidth := lipgloss.Width(ops.ExtraContent)
108+ extraContentWidth := lipgloss.Width(opts.ExtraContent)
120 if extraContentWidth > 0 {
109 if extraContentWidth > 0 {
121 extraContentWidth += 1
110 extraContentWidth += 1
@@ -126,11 +115,11 @@ func Status(ops StatusOpts, width int) string {
127 content := []string{}
116 content := []string{}
128 if icon != "" {
117 if icon != "" {
129− content = append(content, t.S().Base.Foreground(iconColor).Render(icon))
118+ content = append(content, icon)
131 content = append(content, title, description)
120 content = append(content, title, description)
132− if ops.ExtraContent != "" {
121+ if opts.ExtraContent != "" {
133− content = append(content, ops.ExtraContent)
122+ content = append(content, opts.ExtraContent)
136 return strings.Join(content, " ")
125 return strings.Join(content, " ")