summaryrefslogtreecommitdiff
path: root/internal/client/ui/core/chat
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-12-04 18:35:11 +0200
committerKyren223 <Kyren223@proton.me>2024-12-04 18:35:11 +0200
commit37cd043920aa92189d9ae19e7631968290e4d352 (patch)
tree62282034ca56a52bbe36634d77932beaefa5d0ef /internal/client/ui/core/chat
parent567d569dd649cc0b82d6f8890e2bd77b052ebed6 (diff)
Started work on basic vim input box
Diffstat (limited to 'internal/client/ui/core/chat')
-rw-r--r--internal/client/ui/core/chat/chat.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go
new file mode 100644
index 0000000..b3597a8
--- /dev/null
+++ b/internal/client/ui/core/chat/chat.go
@@ -0,0 +1,48 @@
+package chat
+
+import (
+ "log"
+
+ "github.com/charmbracelet/bubbles/textarea"
+ tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/lipgloss"
+
+ "github.com/kyren223/eko/internal/client/ui/colors"
+ "github.com/kyren223/eko/internal/client/ui/viminput"
+)
+
+type Model struct {
+ vi viminput.Model
+}
+
+func New() Model {
+ vi := viminput.New(30, 3)
+ vi.Placeholder = "Send a message..."
+ vi.PlaceholderStyle = lipgloss.NewStyle().Foreground(colors.Gray)
+ vi.LineDecoration = func(lnum int, line string, cursorLnum int) string {
+ return "┃ "
+ }
+ // vi.ShowLineNumbers = false
+
+ // vi.CharLimit = 280
+
+ // vi.Focus()
+
+ log.Println("Placeholder:", vi.Placeholder)
+
+ return Model{
+ vi: vi,
+ }
+}
+
+func (m Model) Init() tea.Cmd {
+ return tea.Batch(textarea.Blink, nil)
+}
+
+func (m Model) View() string {
+ return m.vi.View()
+}
+
+func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
+ return m, nil
+}