Added bento :)
This commit is contained in:
+18
-8
@@ -7,20 +7,23 @@ import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"github.com/atridad/gitea-wrapped/pkg/models"
|
||||
"github.com/atridad/wrapped-cli/pkg/models"
|
||||
)
|
||||
|
||||
type ReportScreen struct {
|
||||
stats *models.UserStats
|
||||
page int
|
||||
maxPages int
|
||||
stats *models.UserStats
|
||||
page int
|
||||
maxPages int
|
||||
exportFile string
|
||||
}
|
||||
|
||||
func NewReportScreen(stats *models.UserStats) *ReportScreen {
|
||||
exportFile, _ := ExportReport(stats)
|
||||
return &ReportScreen{
|
||||
stats: stats,
|
||||
page: 0,
|
||||
maxPages: 3,
|
||||
stats: stats,
|
||||
page: 0,
|
||||
maxPages: 3,
|
||||
exportFile: exportFile,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +70,14 @@ func (rs *ReportScreen) View() string {
|
||||
Foreground(lipgloss.Color("8")).
|
||||
Render(fmt.Sprintf("Page %d/%d | ← → to navigate | q to quit", rs.page+1, rs.maxPages))
|
||||
|
||||
return header + "\n" + content + "\n\n" + footer
|
||||
report := header + "\n" + content + "\n\n" + footer
|
||||
if rs.exportFile != "" {
|
||||
report += "\n" + lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("10")).
|
||||
Render(fmt.Sprintf("✓ Report saved: %s", rs.exportFile))
|
||||
}
|
||||
|
||||
return report
|
||||
}
|
||||
|
||||
func (rs *ReportScreen) renderOverviewPage() string {
|
||||
|
||||
Reference in New Issue
Block a user