package templates import ( "fmt" "time" "git.preston-baxter.com/Preston_PLB/capstone/frontend-service/db/models" ) templ DashboardPage(user *models.User, vendorAccounts []models.VendorAccount) { @Head("Dashboard")
@DashboardNav(user) @DashboardContent(user, vendorAccounts) @Footer()
@DashboardScript() } templ DashboardNav(user *models.User) { } templ DashboardNavItem(icon, name, link string, enabled bool) {
  • { name }
  • } //Break this up templ DashboardContentNav(user *models.User) { } templ DashboardCard(title, primaryVal, secondaryVal, subtitle string) {
    { title }
    { primaryVal }

    { secondaryVal } { subtitle }

    } //Make fmt.stringer the new input //make [][]string //make auth version of widget //make action version of widget templ DashboardTableWidget(title string, table map[string][]string) {

    { title }

    for key := range table { } for _, values := range table { for _, val := range values { } }
    { key }
    { val }
    } templ DashboardVendorWidget(vendors []models.VendorAccount) {

    Vendors

    if len(vendors) == 0 { } else { for _, vendor := range vendors { } }
    Name Status
    No accounts are available. Click + to add one
    { vendor.Name } if vendor.OauthCredentials != nil && vendor.OauthCredentials.AccessToken != "" && vendor.OauthCredentials.ExpiresAt.Before(time.Now()) { Active } else { }
    } templ DashboardContent(user *models.User, vendorAccounts []models.VendorAccount) {
    @DashboardContentNav(user)
    @DashboardCard("Events Recieved", "420,696", "3.3%", "Since Last Month") @DashboardCard("Live Streams Scheduled", "420,696", "3.3%", "Since Last Month") @DashboardCard("Failed Schedules", "420,696", "3.3%", "Since Last Month")
    @DashboardVendorWidget(vendorAccounts)
    } templ DashboardScript() { }