@@ -3,7 +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 useApiClient from "@/hooks/use-api- client"
6
+ import { listPendingQuotesOptions } from "@/generated/ client/@tanstack/react-query.gen "
7
7
import useLocalStorage from "@/hooks/use-local-storage"
8
8
import { useSuspenseQuery } from "@tanstack/react-query"
9
9
import { ViewIcon } from "lucide-react"
@@ -19,11 +19,8 @@ function Loader() {
19
19
}
20
20
21
21
function QuoteListPendingRaw ( ) {
22
- const client = useApiClient ( )
23
-
24
22
const { data } = useSuspenseQuery ( {
25
- queryKey : [ "quotes-pending" ] ,
26
- queryFn : ( ) => client . listPendingQuotes ( ) ,
23
+ ...listPendingQuotesOptions ( { } ) ,
27
24
} )
28
25
29
26
return (
@@ -37,35 +34,29 @@ function QuoteListPendingRaw() {
37
34
38
35
function QuoteListPending ( ) {
39
36
const navigate = useNavigate ( )
40
- const client = useApiClient ( )
41
37
42
38
const { data } = useSuspenseQuery ( {
43
- queryKey : [ "quotes-pending" ] ,
44
- queryFn : ( ) => client . listPendingQuotes ( ) ,
39
+ ...listPendingQuotesOptions ( { } ) ,
45
40
} )
46
41
47
42
return (
48
43
< >
49
44
< div className = "flex flex-col gap-1" >
50
- { data . data ? (
51
- data . data . quotes . map ( ( it , index ) => {
52
- return (
53
- < div key = { index } className = "flex gap-1 items-center text-sm" >
54
- < Link to = { "/quotes/:id" . replace ( ":id" , it ) } > { it } </ Link >
55
- < Button
56
- size = "sm"
57
- onClick = { ( ) => {
58
- void navigate ( "/quotes/:id" . replace ( ":id" , it ) )
59
- } }
60
- >
61
- < ViewIcon />
62
- </ Button >
63
- </ div >
64
- )
65
- } )
66
- ) : (
67
- < > </ >
68
- ) }
45
+ { data . quotes . map ( ( it , index ) => {
46
+ return (
47
+ < div key = { index } className = "flex gap-1 items-center text-sm" >
48
+ < Link to = { "/quotes/:id" . replace ( ":id" , it ) } > { it } </ Link >
49
+ < Button
50
+ size = "sm"
51
+ onClick = { ( ) => {
52
+ void navigate ( "/quotes/:id" . replace ( ":id" , it ) )
53
+ } }
54
+ >
55
+ < ViewIcon />
56
+ </ Button >
57
+ </ div >
58
+ )
59
+ } ) }
69
60
</ div >
70
61
</ >
71
62
)
0 commit comments