32 lines
595 B
Go
32 lines
595 B
Go
package tui
|
|
|
|
import (
|
|
"github.com/charmbracelet/bubbletea"
|
|
"github.com/titor/fanyi/internal/config"
|
|
"github.com/titor/fanyi/internal/translator"
|
|
)
|
|
|
|
type model struct {
|
|
config *config.Config
|
|
translator *translator.Translator
|
|
}
|
|
|
|
func NewApp(cfg *config.Config, t *translator.Translator) *tea.Program {
|
|
return tea.NewProgram(model{
|
|
config: cfg,
|
|
translator: t,
|
|
})
|
|
}
|
|
|
|
func (m model) Init() tea.Cmd {
|
|
return nil
|
|
}
|
|
|
|
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
return m, nil
|
|
}
|
|
|
|
func (m model) View() string {
|
|
return "YOYO翻译 TUI\n\n(基础框架搭建中...)\n"
|
|
}
|