File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { PropsWithChildren, Suspense } from "react"
7
7
import { Skeleton } from "@/components/ui/skeleton"
8
8
import { BalancesResponse , fetchBalances } from "@/lib/api"
9
9
import { useSuspenseQuery } from "@tanstack/react-query"
10
+ import useLocalStorage from "@/hooks/use-local-storage"
10
11
11
12
function Loader ( ) {
12
13
return (
@@ -175,10 +176,26 @@ function PageBody() {
175
176
< OtherBalanceChart />
176
177
</ Card >
177
178
</ div >
179
+ </ >
180
+ )
181
+ }
178
182
183
+
184
+ function DevSection ( ) {
185
+ const [ devMode ] = useLocalStorage ( "devMode" , false )
186
+ const { data } = useSuspenseQuery ( {
187
+ queryKey : [ "balances" ] ,
188
+ queryFn : fetchBalances ,
189
+ } )
190
+
191
+ return (
192
+ < >
193
+ { devMode && (
194
+
179
195
< pre className = "text-sm bg-accent text-accent-foreground rounded-lg p-2 my-2" >
180
196
{ JSON . stringify ( data , null , 2 ) }
181
197
</ pre >
198
+ ) }
182
199
</ >
183
200
)
184
201
}
@@ -191,6 +208,7 @@ export default function BalancesPage() {
191
208
192
209
< Suspense fallback = { < Loader /> } >
193
210
< PageBody />
211
+ < DevSection />
194
212
</ Suspense >
195
213
</ >
196
214
)
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { H3 } from "@/components/Headings"
3
3
import { PageTitle } from "@/components/PageTitle"
4
4
import { Button } from "@/components/ui/button"
5
5
import { Skeleton } from "@/components/ui/skeleton"
6
+ import useLocalStorage from "@/hooks/use-local-storage"
6
7
import { fetchAdminQuotePending } from "@/lib/api"
7
8
import { useSuspenseQuery } from "@tanstack/react-query"
8
9
import { ViewIcon } from "lucide-react"
@@ -55,13 +56,24 @@ function QuoteListPending() {
55
56
)
56
57
}
57
58
59
+ function DevSection ( ) {
60
+ const [ devMode ] = useLocalStorage ( "devMode" , false )
61
+
62
+ return (
63
+ < >
64
+ { devMode && (
65
+ < QuoteListPendingRaw />
66
+ ) }
67
+ </ >
68
+ )
69
+ }
70
+
58
71
function PageBody ( ) {
59
72
return (
60
73
< >
61
74
< H3 > Pending</ H3 >
62
75
< Suspense fallback = { < Loader /> } >
63
76
< QuoteListPending />
64
- < QuoteListPendingRaw />
65
77
</ Suspense >
66
78
</ >
67
79
)
@@ -73,6 +85,9 @@ export default function QuotesPage() {
73
85
< Breadcrumbs > Quotes</ Breadcrumbs >
74
86
< PageTitle > Quotes</ PageTitle >
75
87
< PageBody />
88
+ < Suspense >
89
+ < DevSection />
90
+ </ Suspense >
76
91
</ >
77
92
)
78
93
}
You can’t perform that action at this time.
0 commit comments