diff --git a/18-expenses-chart/templates/index.templ b/18-expenses-chart/templates/index.templ index 9903a27..578fa5a 100644 --- a/18-expenses-chart/templates/index.templ +++ b/18-expenses-chart/templates/index.templ @@ -14,6 +14,10 @@ templ myBalanceComponent() { var days []string = []string{"mon", "tue", "wed", "thu", "fri", "sat", "sun"} +// returns templ SummaryComponent +// with all attributes computed from the expenses slice +// the percentages of the columns, current day number, etc +// NOTE: this seems to be the way to mix go calculations and templates func prepareSummaryComponent(expenses []float32) templ.Component { fmt.Println("hello, preparing expenses: ", expenses) max := slices.Max(expenses) @@ -35,7 +39,7 @@ css expenseBarVars(percentage float32) { templ dayExpenseColumn(expense, percentage float32, day string, isCurrentDay bool) {
- Spending - Last 7 days +
+ Spending - Last 7 days @expensesChart(expenses, percentages, currentDayNum)