@@ -35,11 +35,14 @@ defmodule AlgoraWeb.User.TransactionsLive do
35
35
Payments . subscribe ( )
36
36
end
37
37
38
+ account = Payments . get_account ( socket . assigns . current_user . id , :US )
39
+
38
40
{ :ok ,
39
41
socket
40
42
|> assign ( :page_title , "Your transactions" )
41
- |> assign ( :show_payout_drawer , true )
43
+ |> assign ( :show_payout_drawer , false )
42
44
|> assign ( :payout_account_form , to_form ( PayoutAccountForm . changeset ( % PayoutAccountForm { } , % { } ) ) )
45
+ |> assign ( :account , account )
43
46
|> assign_transactions ( ) }
44
47
end
45
48
@@ -150,15 +153,26 @@ defmodule AlgoraWeb.User.TransactionsLive do
150
153
def render ( assigns ) do
151
154
~H"""
152
155
< div class = "container mx-auto max-w-7xl space-y-6 p-6 " >
153
- < div class = "flex items-end justify-between gap-4 " >
154
- < div class = "space-y-1 " >
155
- < h1 class = "text-2xl font-bold " > Your Transactions</ h1 >
156
- < p class = "text-muted-foreground " > View and manage your transaction history</ p >
156
+ < div class = "space-y-4 " >
157
+ < div class = "flex items-end justify-between gap-4 " >
158
+ < div class = "space-y-1 " >
159
+ < h1 class = "text-2xl font-bold " > Your Transactions</ h1 >
160
+ < p class = "text-muted-foreground " > View and manage your transaction history</ p >
161
+ </ div >
162
+ < . button phx-click = "show_payout_drawer " >
163
+ < . icon name = "tabler-plus " class = "w-4 h-4 mr-2 -ml-1 " />
164
+ < span > Create payout account</ span >
165
+ </ . button >
157
166
</ div >
158
- < . button phx-click = "show_payout_drawer " >
159
- < . icon name = "tabler-plus " class = "w-4 h-4 mr-2 -ml-1 " />
160
- < span > Create payout account</ span >
161
- </ . button >
167
+ <%= if @ account do %>
168
+ < div class = "flex items-center gap-2 " >
169
+ < . badge variant = { if @ account . charges_enabled , do: "success" , else: "warning" } >
170
+ { if @ account . charges_enabled ,
171
+ do: "Payout account active" ,
172
+ else: "Payout account setup required" }
173
+ </ . badge >
174
+ </ div >
175
+ <% end %>
162
176
</ div >
163
177
164
178
<!-- Totals Cards -->
0 commit comments