aboutsummaryrefslogtreecommitdiff
path: root/components/root/statusbar.go
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2025-08-28 13:09:22 +0530
committerPriyansh <[email protected]>2025-08-28 13:09:22 +0530
commit9e82811a2a963be962fc3ffc426c137e01d56e2d (patch)
tree9cde1691f6e8dafb7204b7247dea12af0aa22bf6 /components/root/statusbar.go
parent18b897a36805d1acb6e2352ca536c1eee9249fe3 (diff)
downloadnectar-9e82811a2a963be962fc3ffc426c137e01d56e2d.tar.xz
nectar-9e82811a2a963be962fc3ffc426c137e01d56e2d.zip
Restructure codebase with proper organization, fix file picker navigation, and add utils packageHEADmain
Diffstat (limited to 'components/root/statusbar.go')
-rw-r--r--components/root/statusbar.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/components/root/statusbar.go b/components/root/statusbar.go
new file mode 100644
index 0000000..dd2992f
--- /dev/null
+++ b/components/root/statusbar.go
@@ -0,0 +1,41 @@
+package root
+
+import (
+ "nectar/styles"
+ "nectar/types"
+
+ "github.com/charmbracelet/lipgloss"
+)
+
+func StatusBar(globals *types.Globals) string {
+ w := lipgloss.Width
+
+ helpText := lipgloss.JoinHorizontal(
+ lipgloss.Top,
+ styles.PaddedHorizontal.Render("↑/k: up"),
+ styles.PaddedHorizontal.Render("↓/j: down"),
+ styles.PaddedHorizontal.Render("↹: next"),
+ styles.PaddedHorizontal.Render("^n: new"),
+ styles.PaddedHorizontal.Render("^↵: connect"),
+ styles.PaddedHorizontal.Render("^s: save"),
+ styles.PaddedHorizontal.Render("^t: test"),
+ styles.PaddedHorizontal.Render("^d: delete"),
+ styles.PaddedHorizontal.Render("^c: quit"),
+ )
+
+ versionText := lipgloss.JoinHorizontal(
+ lipgloss.Top,
+ styles.PaddedHorizontal.Render("Nectar "+globals.Version+" ("+globals.BuildDate+")"),
+ )
+
+ separator := styles.BaseStyle.Width(globals.Width - w(helpText) - w(versionText)).Render("")
+
+ return styles.StatusBar.Render(
+ lipgloss.JoinHorizontal(
+ lipgloss.Top,
+ helpText,
+ separator,
+ versionText,
+ ),
+ )
+}