2024-10-04 23:40:03 +00:00
|
|
|
package pages
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reichard.io/antholume/database"
|
|
|
|
"reichard.io/antholume/graph"
|
|
|
|
"reichard.io/antholume/ngtemplates/common"
|
2024-10-06 21:01:37 +00:00
|
|
|
"reichard.io/antholume/ngtemplates/components"
|
2024-10-04 23:40:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
templ Home(
|
|
|
|
settings common.Settings,
|
|
|
|
dailyReadSVG graph.SVGGraphData,
|
|
|
|
userStreaks []database.UserStreak,
|
2024-10-06 21:01:37 +00:00
|
|
|
userStatistics common.UserStatistics,
|
|
|
|
userMetadata common.UserMetadata,
|
2024-10-04 23:40:03 +00:00
|
|
|
) {
|
2024-10-06 21:01:37 +00:00
|
|
|
@layout(settings, "Home") {
|
2024-10-04 23:40:03 +00:00
|
|
|
<div class="flex flex-col gap-4">
|
|
|
|
<div class="w-full">
|
2024-10-06 21:01:37 +00:00
|
|
|
@components.DailyReadChart(dailyReadSVG)
|
2024-10-04 23:40:03 +00:00
|
|
|
</div>
|
|
|
|
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
|
2024-10-06 21:01:37 +00:00
|
|
|
@components.InfoCardLink("Documents", userMetadata.DocumentCount, "./documents")
|
|
|
|
@components.InfoCardLink("Activity Records", userMetadata.ActivityCount, "./activity")
|
|
|
|
@components.InfoCardLink("Progress Records", userMetadata.ProgressCount, "./progress")
|
|
|
|
@components.InfoCard("Devices", userMetadata.DeviceCount)
|
2024-10-04 23:40:03 +00:00
|
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
|
|
|
for _, item := range userStreaks {
|
2024-10-06 21:01:37 +00:00
|
|
|
@components.StreakCard(item)
|
2024-10-04 23:40:03 +00:00
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
2024-10-06 21:01:37 +00:00
|
|
|
@components.LeaderboardCard("WPM", userStatistics.WPM)
|
|
|
|
@components.LeaderboardCard("Duration", userStatistics.Duration)
|
|
|
|
@components.LeaderboardCard("Words", userStatistics.Words)
|
2024-10-04 23:40:03 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|