package ngtemplates import ( "fmt" "reichard.io/antholume/database" "reichard.io/antholume/graph" ) type UserStatistics struct { WPM UserTimeStatistics Duration UserTimeStatistics Words UserTimeStatistics } type UserTimeStatistics struct { All []UserStatisticEntry Year []UserStatisticEntry Month []UserStatisticEntry Week []UserStatisticEntry } type UserStatisticEntry struct { UserID string Value string } // TODO templ InfoCard(name string, size int, link string) { } // TODO templ LeaderboardCard(name string, stats UserTimeStatistics) { } // TODO templ StreakCard(streak database.UserStreak) { } templ Home( dailyReadData []database.GetDailyReadStatsRow, dailyReadSVG graph.SVGGraphData, userStatistics UserStatistics, streaks []database.UserStreak, databaseInfo struct{ DocumentsSize, ActivitySize, ProgressSize, DevicesSize int }, ) {

Daily Read Totals

for index := range dailyReadSVG.LinePoints {
{ dailyReadData[index].Date } { fmt.Sprint(dailyReadData[index].MinutesRead) } minutes
}
@InfoCard("Documents", databaseInfo.DocumentsSize, "./documents") @InfoCard("Activity Records", databaseInfo.ActivitySize, "./activity") @InfoCard("Progress Records", databaseInfo.ProgressSize, "./progress") @InfoCard("Devices", databaseInfo.DevicesSize, "")
for _, item := range streaks { @StreakCard(item) }
@LeaderboardCard("WPM", userStatistics.WPM) @LeaderboardCard("Duration", userStatistics.Duration) @LeaderboardCard("Words", userStatistics.Words)
}