Update tui error handling
- Allow each view to position error banners where they choose - Add global 'esc' key handler to dismiss errors
This commit is contained in:
@@ -121,11 +121,15 @@ func (m *Model) Header(width int) string {
|
||||
return styles.Header.Width(width).Render(header)
|
||||
}
|
||||
|
||||
func (m *Model) Content(width, height int) string {
|
||||
func (m *Model) Content(width, height int, errors string) string {
|
||||
// TODO: see Header()
|
||||
currentModel := " Active model: " + m.App.ActiveModel(lipgloss.NewStyle())
|
||||
m.modelList.Width, m.modelList.Height = width, height - 2
|
||||
return "\n" + currentModel + "\n" + m.modelList.View()
|
||||
content := "\n" + currentModel + "\n" + m.modelList.View()
|
||||
if errors != "" {
|
||||
content += errors
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
func (m *Model) Footer(width int) string {
|
||||
|
||||
Reference in New Issue
Block a user