@@ -3,7 +3,7 @@ import { H3 } from "@/components/Headings"
33import { PageTitle } from "@/components/PageTitle"
44import { Button } from "@/components/ui/button"
55import { Skeleton } from "@/components/ui/skeleton"
6- import useApiClient from "@/hooks/use-api- client"
6+ import { listPendingQuotesOptions } from "@/generated/ client/@tanstack/react-query.gen "
77import useLocalStorage from "@/hooks/use-local-storage"
88import { useSuspenseQuery } from "@tanstack/react-query"
99import { ViewIcon } from "lucide-react"
@@ -19,11 +19,8 @@ function Loader() {
1919}
2020
2121function QuoteListPendingRaw ( ) {
22- const client = useApiClient ( )
23-
2422 const { data } = useSuspenseQuery ( {
25- queryKey : [ "quotes-pending" ] ,
26- queryFn : ( ) => client . listPendingQuotes ( ) ,
23+ ...listPendingQuotesOptions ( { } ) ,
2724 } )
2825
2926 return (
@@ -37,35 +34,29 @@ function QuoteListPendingRaw() {
3734
3835function QuoteListPending ( ) {
3936 const navigate = useNavigate ( )
40- const client = useApiClient ( )
4137
4238 const { data } = useSuspenseQuery ( {
43- queryKey : [ "quotes-pending" ] ,
44- queryFn : ( ) => client . listPendingQuotes ( ) ,
39+ ...listPendingQuotesOptions ( { } ) ,
4540 } )
4641
4742 return (
4843 < >
4944 < 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+ } ) }
6960 </ div >
7061 </ >
7162 )
0 commit comments