@@ -103,19 +103,20 @@ render state =
103
103
, h3 [] [ text " Customer's payment methods" ]
104
104
, div [] (state.paymentMethods <#> paymentMethodHtml)
105
105
, h2 [] [ text " Invoices" ]
106
- , div []
107
- (state.accounts <#> \account -> table []
108
- (account.invoices <#> invoiceSummaryLineHtml)
109
- )
106
+ , div [] (state.accounts <#> \account -> invoiceSummaries account.invoices)
110
107
]
111
108
112
- invoiceSummaryLineHtml :: ∀ m . MonadAff m => Stripe.Invoice -> ComponentHTML Action ChildSlots m
113
- invoiceSummaryLineHtml i =
114
- tr [] [ td [] [ text $ i.customer_email ]
115
- , td [] [ text $ i.account_name ]
116
- , td [] [ text $ i.currency ]
117
- , td [] [ text $ show i.amount_due ]
118
- ]
109
+ invoiceSummaries :: ∀ m . MonadAff m => Array Stripe.Invoice -> ComponentHTML Action ChildSlots m
110
+ invoiceSummaries invoices =
111
+ table [] (invoices <#> invoiceSummaryLineHtml)
112
+ where
113
+ invoiceSummaryLineHtml :: ∀ m . MonadAff m => Stripe.Invoice -> ComponentHTML Action ChildSlots m
114
+ invoiceSummaryLineHtml i =
115
+ tr [] [ td [] [ text $ i.customer_email ]
116
+ , td [] [ text $ i.account_name ]
117
+ , td [] [ text $ i.currency ]
118
+ , td [] [ text $ show i.amount_due ]
119
+ ]
119
120
120
121
customerHtml :: ∀ m . MonadAff m => Stripe.Customer -> ComponentHTML Action ChildSlots m
121
122
customerHtml c =
@@ -138,7 +139,7 @@ customerHtml c =
138
139
, tr [] [ th [] [ text " balance" ]
139
140
, td [] [ text $ c.currency <> " " <> show c.balance <> " cents" ]
140
141
]
141
- , tr [] [ th [] [ text " tax" ]
142
+ , tr [] [ th [] [ text " tax ids " ]
142
143
, td [] [ taxIdsHtml c.tax_ids ]
143
144
]
144
145
]
0 commit comments