diff options
Diffstat (limited to 'internal/client/ui/core/chat')
| -rw-r--r-- | internal/client/ui/core/chat/chat.go | 48 |
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 +} |
